Support Questions

Find answers, ask questions, and share your expertise

Loop and SplitJson iteration

avatar
Contributor

Hello,

hope someone can help me with this point.

I have a json wich has been splitted into 4 fragments.

For every fragment an EvaluateJsonPath is grabbing some attributes from it.

Next, for every fragment, i need to fetch a file from local folder and do an UpdateRecord or QueryRecord(Update Statement) with attribute values contained in every fragment and retrieved by EvaluateJsonPath.

 

So based on my understanding, and sequentially for every fragment, i should:

1 - fetch the local file

2 - UpdateRecord or QueryRecord by updating fields values with fragment attribue

3 - Save file into disk

and repeat(loop) each step for every fragment.

 

However i think this is wrong cause the next fragment could fetch the local file before the previous one is finished(saved to disk updated)

 

How can i achieve this? Which is the best way to sequentially loop over every fragments and do some stuff?

 

Many thanks for your help.

appreciate

2 REPLIES 2

avatar
Expert Contributor

@Ray82 

 

Are you updating the same file that you are reading from?

avatar
Contributor

Yes correct....the file is read in the first fragment, updated and then saved into a local folder....and so on for every fragment. 

 

I want to be sure that every updare is saved without loosing data.