Skip to main content

Notifications

Power Automate - Using Flows
Answered

Update all matching criteria in secondary list when primary list is updated

(0) ShareShare
ReportReport
Posted on by 28

I am attempting to update a secondary list after the primary list is updated using Flow. From time to time my projects (in the primary list) change agents and I need to update all permits with the new agents email address in the secondary list for that project number. The project list form is used to update the project data in SharePoint.

 

I have 2 lists. The first is the primary list called "Projects" , the secondary list is called "Permits".

 

Both the primary and secondary lists have several fields that are different however they include two that are the same,  projectnumber & agentemail

 

The primary list has the field projectnumber as a unique value in SharePoint. The agentemail field only contains one email address.  

 

The secondary list has multiple entries with the same projectnumber with the associated agentemail listed from the primary list.  

 

As stated earlier, my goal is to update all matching projectnumber and agentemail entries in the secondary list that match the primary list when the primary list is modified.

 

Primary List (Before):

Armyrunner_0-1630103800326.png

Secondary List (Before):

Armyrunner_1-1630104028158.png

Secondary List Final Result (After primary list is updated with Wilma on project # 123, joe is no longer listed on the Permits - Flow):

Armyrunner_2-1630104188731.png

 

  • Armyrunner Profile Picture
    Armyrunner 28 on at
    Re: Update all matching criteria in secondary list when primary list is updated

    That worked great. Since I changed the default Title column to projectnumber I needed to have the original field name in place as you pointed out. Thank you for the solution. 

  • Ellis Karim Profile Picture
    Ellis Karim 10,517 on at
    Re: Update all matching criteria in secondary list when primary list is updated

    Sorry, I should have mentioned that you will need to replace the column name projectnumber with the correct name from your Secondary list. I tried to guess. I tested it in my development environment.

    Replace projectnumber with the SharePoint's internal column name from your Secondary list. This can be found in the column settings screen, in the URL. An example is given below where the actual internal column name is StatusPMValue:

    ekarim2020_2-1629799581551.png

    ekarim2020_1-1630258907991.png

    The reason why you are getting the error for the filter query is that you had renamed the SharePoint Title field to projectnumber  - but its internal SharePoint name is still Title. I noted that your Secondary list is missing the default Title column - so you must have renamed it:

    ekarim2020_0-1630263892840.png

    Ellis

  • Armyrunner Profile Picture
    Armyrunner 28 on at
    Re: Update all matching criteria in secondary list when primary list is updated

    Thank you for your interest. When I apply this solution I get a flow failure. It appears the filter suggested is not working properly. The error suggests that the column projectnumber does not exists however it clearly does in both lists.

     

    This is the error:

    Armyrunner_1-1630254319230.png

     

     

    This is the suggestion:

    Armyrunner_0-1630254141113.png

    This is what was inputted into the flow. 

    Armyrunner_2-1630254446150.png

    This is the primary list showing the projectnumber field

     

    Armyrunner_3-1630254672502.png

     

    This is the secondary list showing the projectnumber field

     

    Armyrunner_4-1630254787349.png

     

     

    Suggestions?

     

  • Verified answer
    Ellis Karim Profile Picture
    Ellis Karim 10,517 on at
    Re: Update all matching criteria in secondary list when primary list is updated

    The flow would resemble something like this:

    • When an item is modified in then Primary list,
    • Get all the items in the Secondary list that have a matching project number (Filter Query)
    • Update each of the items we got from Secondary list with the updated agent email address

    ekarim2020_0-1630191530801.png

    We then update all the items we got from the Secondary list (stored in value) with the updated agent email address:

    ekarim2020_1-1630192048594.png

    Here is a closer look at which columns are being used in the Update item action (click the image to view a larger version of the image):

    ekarim2020_2-1630193360250.png

    Hope this helps.

    Ellis

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard

Featured topics

Restore a deleted flow