10-15-2023 08:41 PM - edited 10-15-2023 08:48 PM
I have a input json file like below please see the dummy example below
{ "totalCount": 2, "dataList": [ { "IFA": "IFA1", "voltage": "200", "power": "100", "equipid": "1234ABC", "SN": "SalesForce-1" }, { "IFA": "IFA2", "voltage": "200", "power": "100", "equipid": "1234ABC", "SN": "SalesForce-1" } ] }
I have to read this file and process the Items one by one.
First I have to get the IFA number and then do Salesforce lookup to get the Id from sales force .
Then the output Id from the salesforce should be mapped to accountID field and this along with other data in the file should be passed to SalesForce upsert snap.
can anyone help me on how to do this? I am new to snaplogic
Solved! Go to Solution.
10-16-2023 01:24 AM
You just need to split the array using the JSON Splitter Snap, once you read the file and parse the content, so you will have the nested structure split and pipeline will process the records one by one. Then you can proceed with developing the rest of the logic.
Note: You should use REST API Mode within the Salesforce Snaps, in order records to be processed one by one.
10-16-2023 01:24 AM
You just need to split the array using the JSON Splitter Snap, once you read the file and parse the content, so you will have the nested structure split and pipeline will process the records one by one. Then you can proceed with developing the rest of the logic.
Note: You should use REST API Mode within the Salesforce Snaps, in order records to be processed one by one.
10-16-2023 01:52 AM
Thanks @SpiroTaleski I will try that
10-18-2023 04:41 AM
One more question.
I have the following snap structure
read from JMS ( List of object) -> Json Splitter -> lookup on sales force for ID -> Send data to sales force using salesforce upsert -> maps and post it to JMS.
What's happening here is data is being posted individually. is it possible to collect it in a single JSON and send it once to JMS?
10-18-2023 05:08 AM
Yes, you can utilize Group By N Snap in order to have a list with all records inside. You can specify also the size of each group within the snap.