I have created a flow. Inside this flow I have some json array like below. I would like to loop into this json array. For each item in this array I would like to append a variable.
Json:
[{"Date":"21-01-2018","Project":"Project 2","ProjectCode":"12100003","Breakdown":"Start","Status":"Hard","TimeFrom":"09:00","TimeTo":"23:55","Hours":"14.92"},{"Date":"22-01-2018","Project":"Project 3","ProjectCode":"12100004","Breakdown":"Start","Status":"Zacht","TimeFrom":"09:00","TimeTo":"17:00","Hours":"8.00"}]
I would like to have at the end some variable like this:
21-01-2018<br/>Project 2<br/>12100003<br/><br/>22-01-2018<br/>22-01-2018<br/>Project 3<br/>12100004
My target is to add this variable inside the approval task email body. I already using the "Apply for each" action on the json array. Who can tell me how to do this?
Hi @khalidinio,
Could you please share a screenshot of your flow's configuration?
Do you want to append the variable ('21-01-2018<br/>Project 2<br/>12100003<br/><br/>22-01-2018<br/>22-01-2018<br/>Project 3<br/>12100004') that you mentioned for each item within the json array?
I have made a test on my side and please take a try with the following workaround:
addProperty(item(),'variable1','21-01-2018<br/>Project 2<br/>12100003<br/><br/>22-01-2018<br/>22-01-2018<br/>Project 3<br/>12100004')
Note: The addProperty() function returns an object with an additional property.
Image reference:
The flow works successfully as below:
More details about the addProperty() function, please check the following article and search for it:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#functions
Best regards,
Kris
Thank you for the solution. It works! I make it work without the compose and addProperty tasks. I initialize a variable and append this variable in the apply for each.
Hi @khalidinio,
Do you need any other help?
Best regards,
Kris
Great Solution , Thanks.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
22 | |
21 | |
9 | |
7 | |
7 |
User | Count |
---|---|
33 | |
31 | |
24 | |
22 | |
11 |