AZURE Logic Apps Expression with a variable property

Rafał Lesiński 20 Reputation points
2023-12-08T22:56:04.5866667+00:00

I have a case where I need to refer to a value in JSON

body('Parse_JSON_product')['values']['Media_Pictrue_Main_1'][0]['_links']['download']['href'].

I do this with an expression that I assign to a variable. However, I have a problem because ['Media_Pictrue_Main_1'] can have different values, e.g. ['Media_Pictrue_Main_2'], ['Media_Photo_Main_1'], ['360Photo']. How to insert a variable into an expression? I tried this:

body('Parse_JSON_product')['values']['@{body('Parse_JSON_2')?['media']}'][0]['_links']['download']['href'],

but I get an error expression when I try to save.

User's image

I tried the compose element and then using it in the expression for the variable, but that didn't help either.User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,390 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rafał Lesiński 0 Reputation points
    2023-12-19T13:42:56.52+00:00

    The problem is that I have already worked around this problem and it is not possible to reproduce this problem in my example. I will create another example and send it. Sorry for the delay.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.