Constructing a JSON list that is compatible with the destination application requires few steps in automation.
- Add a variable block and define a list:
- Go to Manage Variables
- Enter List name
- Change variable type to "List"
- Save.
- Empty this list by selecting the 'Empty' operation in the block.
- Loop through the Source list to iterate through each object of the list.
- At this point, we'll have to construct each object for our destination list with the appropriate Key-Value pair.
You will need another variable block inside the loop with the type "Object".
- Select the "Set key/value" operation for this variable block and enter the destination Object's Keys. Map the values for this object by selecting the values from the source list.
- Add another variable block and select the previous list variable. Now, add the operation "Add Item to" and select the object variable previously constructed.
- We can use the output of this final list variable as a destination list.
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.