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 / SharePoint Create Item...
Power Automate
Unanswered

SharePoint Create Item - Two Conditions from Different Places?

(0) ShareShare
ReportReport
Posted on by 4

Is there a way to have the condition logic be looking at a second place in addition to the associated SharePoint list?


For example: I would like the Flow to create an item if a field value equals Yes. I want this to run on Created/Modified. But what I don't want it to do is create an item each time the item is modified, I only want it if it doesn't exist.


So how can I write the logic where

 

'check if this value is yes' = Yes (sitecollection1\site1\list1)

 

AND

 

'IDofItemFromSite1' doesn't exist in (sitecollection1\site2\list1)

 

If are true, create a new item in list.

I used to be able to do this with SharePoint designer, but now that my lists are in different sites and I have to use MS Flow, I'm not sure how to accomplish this, or if it is even possible.

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

    Hi @DLoweinc,

     

    Would you please share a screenshot of your flow configuration?

    Condition may vary based on the action you would like to work with.

     

    Regards,

    Michael

  • DLoweinc Profile Picture
    4 on at

    Learning Solutions MS Flow proposed.png

    Basically in the condition field where ID is not equal to ID, I want to compare two different list values.

     

    Something like:

     

    ID is not equal to ID from List 1

     

    I just don't know how to change the data source that shows up in the dynamic lookup, or how to write the expression another way.

  • Verified answer
    v-micsh-msft Profile Picture
    on at

    Hi @DLoweinc,

     

    If the create item action is used for another SharePoint List, then there is a workaround to deal with this situation.

    For example, the when an item is created or modified is configrued with List 1, and the create item action is used under List 2,

    Then we could build the Flow in the following way:

    First, add a field under List2 to mark the ID of List1, let us call it MarkID (should be number type),

    Second, add a Get items action, specify to List2, click advanced options, under Filter Query, specify the following:

    MarkID eq  [ID]

    The ID should be the dynamic content from List1.

    After that, add a condition, click the advanced option, and copy and paste the following:

    @empty(body('Get_items')?['value'])

    If the condition evaluates to yes, it means List 2 didn't contain an item created from List1, so we could then add the create item action under the Yes part.

     

    Regards,

    Michael

  • DLoweinc Profile Picture
    4 on at

    I spent a few hours attempting to get this to work properly and I have been unable to.

     

    When I do the "Get Items" action, which allows me to use logic from my 2nd list, it adds a 'for each' condition automatically.


    This means when I added the logic to say "IDfromList1" doesn't exist in "List2", because it is comparing to each item in the list, there are many successful returns, I only want it to successfully return if after going through all items, none of them equal.

     

    I'm still attempting to figure this out, your reply has gotten me much farther and shown me some functionality that I didn't know existed, but I cannot yet get it to do what I want.

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard