Not able to append json data

Yahya Shareef 1 Reputation point
2021-12-01T16:54:09.38+00:00

I am trying to append json data based on for each loop records, lets say if i have 5 records then i need to append json data 5 times for each record with appropriate record values. example below.
{ "id": "1","name":"yah"},{ "id": "2","name":"yahy"},{ "id": "13","name":"yahya"},{ "id": "14","name":"sharee"},{ "id": "16","name":"yahha"},{ "id": "18","name":"yahhaya"},

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2021-12-02T04:43:51.947+00:00

    @Yahya Shareef Assuming your input record is in an array and you are looping in using 'for each' action. You need to initialize a variable of type string and inside the foreach loop use Append to string variable action to the string according to your JSON requirement. You can change or add action to create the right JSON format i.e. add '[' ']' as the json should be array to parse it correctly.

    154257-image.png

    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.