REST API Paging Advice (Breaking JSON)

REST API Paging Advice (Breaking JSON)

Comments

  • We are paging through a REST API which returns JSON. For each subsequent call we need to get the last ID from the page before.

    We have been able to achieve this using JSON Deserialisation in the flow (after creating the JSON structure), but ideally we wouldnt have to deserialise the JSON in order to do this.

    We have seen the step "Get Value From Json By Name" which we believe may give us the result we need, but there is no documentation on how this works.

    1. Whats the best way to achieve this?
    2. Is the step "Get Value From Json By Name" an option?
    3. If so, what is the syntax for the "Name" variable if the value we need is nested in multiple levels?

    Thanks in advance for any help.

  • [font=Roboto]Hi Andy, you might try dot notation (Structure.Property.MyData) to get the correct data from your JSON text. If that does not work, then your best option would be to deserialize the data and map the data accordingly.[/font]

  • Unknown
    edited November 2023

    Hi, thanks, but this doesnt work. I dont want to fully deserialise the data so this isnt an option (for multiple reasons).
    The step only works on single levels, so what I have ended up doing is writing a loop where I pass a list of elements in, and it breaks through each in turn -

    so if the json was - "{data:{firstelement:{secondelement:{id}}} then the list would contain data, firstelement and secondelement and then fieldname (extracted after the loop) would be "id"

    however I still feel that this isnt the best way, so if you do find out any further information about this or other steps which would help, then Id be eager to hear them.

    Thanks
    [i]edited by Andy Franklin on 11/10/2020[/i]

Sign In or Register to comment.