-
1. Re: Need help on Creating List
Jharana Patra Feb 16, 2021 10:18 PM (in response to user 9052)Hi ,
What's the data type that you are using to store the result in the process?
Is it type any r the process object ?
-
2. Re: Need help on Creating List
user 9052 Feb 16, 2021 10:21 PM (in response to Jharana Patra)using datatype as "list of any"
-
3. Re: Need help on Creating List
Rich Bateman Feb 17, 2021 6:27 AM (in response to user 9052)It looks like you have an assignment step to build your JSON body and you want to always set an array. Here's how you do it:
Original:
for $row in $output.dataAccessResponse/row
return
<Appt>
<ApptEffDate>{$row/ApptEffDate/text()}</ApptEffDate>
<AptExpDate>{$row/AptExpDate/text()}</AptExpDate>
</Appt>
New:
for $row in $output.dataAccessResponse/row
return
<root xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data">
<Appt m:isArray="true">
<ApptEffDate>{$row/ApptEffDate/text()}</ApptEffDate>
<AptExpDate>{$row/AptExpDate/text()}</AptExpDate>
</Appt>
</root>
You may want to clean up your assignment step but by setting those 2 attributes you can force the array when your output contains a single record.
Thanks,
Rich
-
4. Re: Need help on Creating List
user 9052 Feb 17, 2021 9:22 PM (in response to Rich Bateman)Thank you ,solution worked for me