web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / After parsing .JSON, c...
Power Automate
Unanswered

After parsing .JSON, create or update items in Sharepoint

(0) ShareShare
ReportReport
Posted on by 40

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

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    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,

  • MashaOvchar Profile Picture
    40 on at

    Hi @v-jefferni ,

     

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

  • MashaOvchar Profile Picture
    40 on at

    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

     

     



  • CRod Profile Picture
    62 on at

    Did you figure this out? Im having the same issue.

  • MashaOvchar Profile Picture
    40 on at

    Unfortunately no... 

  • CRod Profile Picture
    62 on at

    I was able to figure out the issue. If you see in your "if no" statement you have two "apply to each" blocks. You have two items in 'apply to each 3' and two in 'apply to each 4'. 

     

    I'm new to flows too, hope this makes sense. 

    When you run the 'if no' statement. It takes the first item in 'apply to each 3'  then runs 'apply to each 4' twice since it has two items.  Then it goes to your second item in 'apply to each 3'  and runs again  'apply to each 4' again twice because there are two items. 

     

    You need to arrange your statements so you dont create a new "apply to each" . Capture1.JPG

  • DynamicDerek Profile Picture
    3 on at

    I had the same issue as the OP, @MashaOvchar
    Thank you for the solution, @CRod!

    DynamicDerek_0-1695013077043.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard