Skip to main content
Community site session details

Community site session details

Session Id : eVGsso7KfocIc0eWppE8c5
Power Automate - Building Flows
Unanswered

Get Specific Item from a SharePoint List based on a value in another list

Like (1) ShareShare
ReportReport
Posted on 20 Jul 2017 14:32:52 by 26

I have 2 sharepoint lists.  When a user creates an item is created in List 1 I have a Microsoft Flow that creates an item in List 2.  The workflow also stores the ID of the item in List 1 as a number column in List 2 and stores the ID of the item in List 2 in a number column in List 1.  This way it is easy to see which items are related in each list.  This gives me a virtual one-to-one relationship.

 

When the item in List 1 is changed I want to update some columns in the related item in List 2.  How can I get the related item in List 2.  I thought I would simply be able to use the 'SharePoint Get Item' using the ID number stored in List 1 to get the correct List 2 item, but I don't see how?

 

What am I missing?  Do I have the wrong approach?

  • Mugwomp Profile Picture
    3 on 08 Apr 2022 at 08:32:44
    Re: Get Specific Item from a SharePoint List based on a value in another list

    If you use Get Items then you can include a Where clause to only return the single item you require

  • v-yamao-msft Profile Picture
    on 24 Jul 2017 at 09:57:46
    Re: Get Specific Item from a SharePoint List based on a value in another list

    Hi Anorakman,

     

    A documentation for Microsoft Flow is:
    https://flow.microsoft.com/en-us/documentation/getting-started/

     

    You could get more details about Flow at here.

     

    Also, Workflow definition language is also useful when configuring a flow:
    https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

     

    Best regards,
    Mabel Mao

  • Anorakman Profile Picture
    26 on 21 Jul 2017 at 08:21:18
    Re: Get Specific Item from a SharePoint List based on a value in another list

    Thanks Mabel

     

    Thanks for the solution.  That's what I ended up doing.

     

    My frustration came from the SharePoint Get Item action (as opposed to the Get Item's' action), which seems to offer the chance of finding a specific item in a list, but doesn't really.  Is there an underlying reason for there being no ability to add a simple 'where' condition to make sure the flow gets the right item from a list?

     

    An additional complication is that I am working with imported data and wanted to set a condition where, if List 1 doesn't have an entry for a related List 2 item, the flow creates a new item in List 2 and updates the relative IDs in both lists.  I failed to find a successful way to branch either to updating the related record in List 2 or creating a new one.  The columns holding the ID of the related item is null when the list imported.  The condition, like the one you illustrate, to update the existing List 2 item is straightforward, but I failed to find a condition that successfully branched based on a null value in the column in List 1 holding the IDs of related List 2 items.

     

    For clarity, the flow I was trying to create went like this:

     

    Condition:  'IDList2 in List 1' is null (this is where I failed)

    Yes: Action: Create new item in List 2 and update related ID information in columns in Lists 1 and 2

    No: Condition: 'IDList2 in List 1' = List 2 ID

    Yes: Action: Update List 2 item

    No: Do nothing

     

    My workaround was to change the null values in the IDList2 column to 0 so the first condition is now:

     

    'IDList2 in List 1' = 0

     

    This works.  However, I would be pleased to know if it is possible to filter out null values from a SharePoint number column using a condition in Flow.  I couldn't get @empty(... to work here either.

     

    As an aside, is there a comprehensive guide or reference for Microsoft Flow?  Searching seems to turn up tidbits, but nothing compiled.

     

    Thanks for your solution.

     

    Anorakman

  • v-yamao-msft Profile Picture
    on 21 Jul 2017 at 03:10:33
    Re: Get Specific Item from a SharePoint List based on a value in another list

    Hi Anorakman,

     

    Please consider to add a Condition in the flow to check if the ID in List1 is equal to the ID Column in List2.


    According to your description, I create two Lists, List1 and List2. There is a Number column named List1ID in List2 which is used to store the ID of the item in List1.


    The flow is configured looks like below. If the ID is equal to List1ID, update item in List2. In the Update item action, configure the Id and List1ID field with the dynamic content ID from the trigger “When an existing item is modified”.

    3.PNG

     

    Hope this could be a reference for you, please try if this will work for you.

     

    Best regards,
    Mabel Mao

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

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!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete