cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BarbaraSelden
Regular Visitor

dynamically select item ID to update item, or create condition to specify item number

I have a source list used for lookups in a sign up list for volunteers,  

Source list contains ID, several fileds for look up, and a field called AVAILABLE which is by default yes.

 

Let's call these SourceLIstID and SourceListAvailable

 

In the volunteer list, users select an opportunity form the source list, and I capture SourceListID in a field called MasterID.  so MasterID = SourcelistID

 

Once SourceList item is chosen in the volunteer list, i want to set AVAILABLE to NO for that item in the SourceList. 

Since i have the item id of the item in the source list, i want to se up a flow that does the following:

 

Update item where SourceListID = VolunteerListMasterID, and change SourceListAvaialble to No

 

So, this would be easy if i could dynamically choose the item ID, which doesn't appear possible, so i need a condition that specifies the item to be updated, and i am stumped.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

This may solve your problem.

 

I created a list called Volunteer with a lookup to a list called Source.  The lookup column is called Opportunity.

When I create an item in Volunteer, my Flow runs and selects the row in the Source list where the ID is equal to the Opportunity Id.

SharePoint actually stores the ID of the item in the lookup list and it is exposed in Dynamic properties (Opportunity Id).

 

Screen shots are below.

 

UpdateLU1.jpgUpdateLU2.jpg

 

If this solves your issue, please mark your question as Resolved.

 

If this does not resolve your issue, please provide additional detail.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

6 REPLIES 6
ScottShearer
Super User
Super User

This may solve your problem.

 

I created a list called Volunteer with a lookup to a list called Source.  The lookup column is called Opportunity.

When I create an item in Volunteer, my Flow runs and selects the row in the Source list where the ID is equal to the Opportunity Id.

SharePoint actually stores the ID of the item in the lookup list and it is exposed in Dynamic properties (Opportunity Id).

 

Screen shots are below.

 

UpdateLU1.jpgUpdateLU2.jpg

 

If this solves your issue, please mark your question as Resolved.

 

If this does not resolve your issue, please provide additional detail.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

This is helpful. However, however it is updating the items with the wrong ids.

For example, i chose opportunity with Source ID 2 in the volunteer list, the flow updated the Source item with Id 23.Any ideas?

Please post a screen shot of your Flow and I will try to assist.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thanks so much. Before updating as you describe above, the flows indicated success, but were updating the worng item

dg-wrong item.PNGOnce i updated it to include the get items which triggered the "apply to each", it just fails altogether at the "apply to each" step.

Note: Source list is called AMster.

MAster ID is the field in the volunteer list that captures the source list item's id. 

DG-wf.PNG

Scott's solution is correct. However, initially in the update item ID, i had only one choice (which said "ID" and trurned out to be the Id of the secondary list's item); after deleting and recreating, i had two choices--one for "when item created" step, and one for "get items" step. the second is the one i needed.

 

I believe the second and necessary didn't show because the "get items" step was inserted later than the "update items step".

 

@ScottShearer you are on true legend !!!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,342)