Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Check if record exists in Sharepoint and if not - create item

(0) ShareShare
ReportReport
Posted on by 58

Hi all, I am very new to Power Automate so I would ask for some help. I managed to do the following:
I get data from SAP, parse JSON from it, filter the array from parsed json, set variable for every entry and make a new array out of it (append to array variable).
I get data from Sharepoint, compose the column I need, set variable from items in it, and append it to array variable.

 

In the last step I want to make a condition to check if the elements from SAP new array exist in the Sharepoint array, and if not, I would like to add them to the Sharepoint table (create item).


I tried numerous things but I either end up with 1 new entry, with duplicated entries, with multiplied entries (for array x array items) or with a blank entry. Can somebody please advise? Thank you very much for the help!!

shibathedog_0-1630511968589.png

 

 

shibathedog_1-1630512002153.png

 

shibathedog_2-1630512025200.png

 

In the screenshoted example I have: 2 entries in the Sharepoint, 7 entries in the SAP array (of which 5 should be written to sharepoint) but I end up with 7 times one of the entries (so the same entry entered 7 times and nothing except it).

 

Thanks

  • shibathedog Profile Picture
    58 on at
    Re: Check if record exists in Sharepoint and if not - create item

    I think the Apply to each x3 is too much to handle, well depending on the number of items you have. Can you try to do a condition with a create item if it doesn't exist and an update item if it exists?

  • MashaOvchar Profile Picture
    40 on at
    Re: Check if record exists in Sharepoint and if not - create item

    Hi @shibathedog ,

     

    thanks for the fast reply! But it seems I'm still having trouble.. My initial flow was, when a .JSON is created in a Sharepoint folder, it needs to be parsed, then an item needs to be created in a Sharepoint list.
    But at the end I want to check if an item (eg. filtered on OrderNumber) already exist in the list, if so it needs to be updated, otherwise a new item should be created. Have tried a couple of times.. most of the time the flow gets in a loop.. 

    Initial flow:

    MashaOvchar_0-1653641965021.png

    MashaOvchar_1-1653642271727.png


    What do you think? Any ideas?

  • shibathedog Profile Picture
    58 on at
    Re: Check if record exists in Sharepoint and if not - create item

    Hi @MashaOvchar ,

     

    I hope this will help you:

    ans1pa.jpg

     

    If not, please share your problem and I might be able to help out!

  • MashaOvchar Profile Picture
    40 on at
    Re: Check if record exists in Sharepoint and if not - create item

    Hi Shibathedog,


    Do you mind sharing your end results? I'm stuck with the same problem, but having no clue what you mean.. 
    Thanks in advance! (:

  • Verified answer
    shibathedog Profile Picture
    58 on at
    Re: Check if record exists in Sharepoint and if not - create item

    Solved it! I should've passed item() to reference items in the list, and not the name of the variable which went into the array. The same for writing to sharepoint.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1