In my modern SharePoint solution series (see here) I created an approval step in my flow. One of the items I had on my list of things to add was to capture responses from the approver and add them to the list for review. I thought that before I covered that, I would first provide the steps for updating a list item from Microsoft Flow. I realize this is a fairly basic thing to do, but I also know that there are many just starting out in Flow and sometimes having these “easy” steps is nice to have.
Updating a List Item from Microsoft Flow
The steps are pretty straightforward. Basically, you just need to follow these steps:
- Trigger when the item is added, updated or whichever trigger works for your situation.
- Get the item that triggered the workflow.
- Add the update item action to the flow:
- In the update item action, you need to basically get the item all over again before you update the fields
Note: You may think that you don’t need to get the item as you did in #2. However, because Title is a required field, Flow always requires that you have to fill in this field, so you are going to need this even if you aren’t updating that field.
- Next, you simply set the field as you want. What’s great about Flow is once you have loaded an item you can then use the data within that loaded item to update the field if you wish from the dynamic content list.
- Finally, you can set text fields to whatever you feel like or make it a combination of dynamic content and set text.
- Choice fields are also very easy as Flow will load them into the designer and you can select the item you want.
One thing to make sure you are aware of. If you make changes to the list and remove a choice the workflow is using you have to update the flow and change the choice field. The workflow will NOT fail. It will still manage to place the old value in the field even though it isn’t a viable option. Need to make sure everything is synced up.
Thanks for reading!!
Comments
How do you get rid of the “Apply to each” loop if you only want to update one item?
If you are getting the “Apply to each” loop it’s because Power Automate is detecting the method you are gathering the item has the possibility of having multiple items. You will either have to get the item in a manner that only returns a single value (get item by ID) or allow it to loop. If you are only getting back a single item, then the Apply to each will only run once.