Azure Logic App - Salesforce get records continously using the the odata.nextlink

Siddharth Kumar 71 Reputation points
2022-03-07T01:52:49.697+00:00

Hi
I am trying to download data from a salesforce object and write to a Blob. The object is huge so I put a filter condition

**SystemModstamp ge 2022-01-01T00:00:00Z AND SystemModstamp le 2022-03-03T23:59:59Z**

With this filter condition i am expecting about 33000 records

What i get is the first 200 records. I see there is a json element "@odata.nextLink" - which possibly points to the next data set. My question is - how can I design a logic app that gets the first data set add its to a CSV table and then recursively uses the nextlink to get the next data set and add it to the same CVS table - so after all iterations i can write the contents of the table to a Blob.

Thanks
Regards
Sid

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

Accepted answer
  1. MayankBargali-MSFT 68,656 Reputation points
    2022-03-07T13:32:24.103+00:00

    @Siddharth Kumar You can leverage Until action till your json element has @odata.nextLink field. Before the until loop, you can define the variable of type string and inside the loop you can leverage Append to string variable that will keep appending your CSV string data. Once the Until loop is completed you can leverage the Create blob V2 action of storage blob connector to create the file with your variable that has your CSV table string.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Steve 1 Reputation point
    2023-01-06T16:11:25.783+00:00

    @MayankBargali-MSFT Is there not a limitation with Salesforce where you cannot get more than 50K records. I thought you had to use the topcount and skip count to get around this?.

    I have been trying this approach but cannot get this working also. Can someone post a screen of the flow like @Hussain Zuheb EXT Infosys - Fluido has requested so we can see.

    Much appreciated.
    Steve

    0 comments No comments