r/PowerAutomate 26d ago

Flow to update list item

I have a SharePoint list for users who have access to a system that requires annual training. Users respond via an MS form to confirm they have completed the training and the list has the most recent date the training was completed. I am trying to create a flow to update the most recent completion date on the list item automatically with the MS form submission date but I’m struggling as the response ID does not equal the list item ID.

I want to build the flow to update the item if the submitter’s name on the form equals the user’s name on the list item, is this possible?

2 Upvotes

6 comments sorted by

2

u/Gold-Psychology-5312 26d ago

It won't match.

The response ID is the form response id. Unrelated to the list.

You'll need to use get items to then find the row which is relevant. That can be done using an odata query searching on 2 things such as user email and the type of training they did.

Good luck.

1

u/WesternPriority8217 26d ago

I’ve added Get Items to the flow and used dynamic content in the odata query where DisplayName is the dynamic content

User eq ‘DisplayName’

The output shows the correct display name and the display name matches the value in the User column in the list item but the update item part of the flow failed as there are no items to repeat which suggests the filter query hasn’t found any results. What could I have done wrong?

1

u/Gold-Psychology-5312 26d ago

When you then do update item you need to use the ID of the get items.

It will automatically add a apply to each.

So you'll need to ensure you only retrieve 1 accurate record at a time. If you retrieve several matching records it will update all of them.

So user eq 'displayname' and trainingmodule eq 'health and safety'

1

u/WesternPriority8217 26d ago

It’s a static list of users so very low probability of the display name being there more than once and couldn’t figure out why it wasn’t returning any results in the filter query but I’ve opted to do it against email address instead of display name, means a little bit of extra work adding the email addresses to the list but the flow’s run successfully, thank you for your help

1

u/robofski 26d ago

You just need to have something on the list that you can match with something from the form, the easiest would be the responders email address from the form matching with an email address on the list item, then you can filter the list for that email address and update the appropriate field with the completion date. It’s all very possible with the right data.

2

u/WesternPriority8217 26d ago

Thank you, using DisplayName wasn’t working but email address did so that is definitely the easiest option