cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MashaOvchar
Frequent Visitor

After parsing .JSON, create or update items in Sharepoint

Hi community, 

 

I am attempting to build a flow where I need to parse a .JSON and create or update those items in SP list.

I have the flow working, expect for the final step I get lost.. I need to add a control where it checks if those items already exist (WorkInstructionNumber) in Sharepoint, if yes, they need to be updated. I either end up in a loop or ALL my items in my SP list get updated..

Any ideas someone? 

 

.JSON:

 

 

[{"WorkInstructionNumber":"1620348",
"WorkInstructionSubfileNumber":1,
"ETA":"2022-03-30T00:00:00",
"Description":"XXX",
"LocationDescription":"YYY",
"RegioCode":"ZZZ",

"Customers":
[{"CustomerName":"Client A",
"CustomerReference":"123456789",
"Required":"Y",
"UpdatesTo":"XXX",
"CustomerLetter":"A"},

{"CustomerName":"Client B",
"CustomerReference":"987654321",
"Required":"N",
"UpdatesTo":"",
"CustomerLetter":"B"}]}]

 

 

 

Visual 

MashaOvchar_1-1656071865841.png

 

My current flow:

MashaOvchar_2-1656071953807.png

3 REPLIES 3
v-jefferni
Community Support
Community Support

Hi @MashaOvchar ,

 

Technically, you need a Condition control after a List items of the list as well as the Filter array operator, you also need an Integer variable to countrows outputs of Filter array, in the Condition control, if the variable equals to 0, create item, else update item (item ID could be found in the Filter array outputs).

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-jefferni ,

 

Thanks for the quick reply, but you lost me at the first sentence. 😅

Hi @v-jefferni ,

Almost there, but not quite yet..  It seems when the item gets updated, each ID gets updated with details from each costumers.. So I end up for each ID with same customer details of the last customer in the .JSON..

Any ideas how to work around this? Much appreciated.

MashaOvchar_0-1658749488551.png

MashaOvchar_1-1658749504047.png

 

MashaOvchar_0-1658750208214.png

 

 



Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (1,798)