Forum Discussion
Based on the Example 4 of the REST GET documentation, I tried to use the solution but getting errors. Attached is the screenshot of the REST GET snap which is used in my pipeline.
The scenario for my REST GET is mentioned below. The API URL has a header key for authorization as mentioned in the screenshot.
https://xxxxxx–xxx/transactions?datestart=2018-12-16T00:00:00&dateend=2018-12-17T00:00:00&pageSize=1000&pageNo=1
If the above URL has response with data, then the below should be triggered
https://xxxxxx–xxx/transactions?datestart=2018-12-16T00:00:00&dateend=2018-12-17T00:00:00&pageSize=1000&pageNo=2
If the above URL has response with data, then pageNo gets incremented until there is no data returned for the API.
The Has next attribute is set as “$entity.Items[*].length > 0” as i am checking the condition if the API returns any data. But the expression is failing.
Also the Next URL is set in such a way that it takes the input parameter along with the incremental value for pageno. Does this need to have the Header Authorization Key in the call? Please advise and help.
Thanks
Aravind N
can you share the JSON output of this REST GET without pagination?
The best way to design “has next” and “next URL” I found is to use a mapper after REST GET to come up with an expression that will give you true for “has next” and next page URL for “next URL”. Once you figure those out then just copy those expressions back to the REST GET configuration.
Attached is an example pipeline. Note that you will need to extend the XSD defined for the XML Formatter, but this should solve this request.
Example_XML_attributes_to_elements_2020_06_29.slp (7.8 KB)
Note that you will need to rename the following attachments to remove the “.txt” extension - this was done just so I could upload.
catalog_with_attributes.xsd.txt (762 Bytes) catalog_with_attributes.xml.txt (201 Bytes)- Dhivya_Aroma16 years agoNew Contributor III
Hi KoryKnick,
Thanks for the solution. This worked. I understand that xsd is mandatory for the transformation.
Regards,
Dhivya.
- Dhivya_Aroma16 years agoNew Contributor III
Sorry. Only values are pasted and not the tags.
<catalog> <plant botanical="Sanguinaria canadensis" zone="4" light="Mostly Shady">Bloodroot</plant> <plant botanical="Aquilegia canadensis" zone="3" light="Mostly Shady">Columbine</plant> </catalog>
Thank you for providing your input. Can you also provide an example of your desired output?
- Dhivya_Aroma16 years agoNew Contributor III
This is the expected result
<catalog> <plant> <botanical>Sanguinaria canadensis</botanical> <zone>4</zone> <light>Mostly Shady</light> <plantValue>Bloodroot</plantValue> </plant> <plant> <botanical>Aquilegia canadensis</botanical> <zone>3</zone> <light>Mostly Shady</light> <plantValue>Columbine</plantValue> </plant> </catalog>
Once all the attributes are converted to element the final value of plant (i.e., Columbine) needs the new tag name, like here, I have provided plantValue.
Related Content
- 3 years ago
- 2 years ago
- 12 months ago
- 2 years ago