I am trying to build a flow that involves updating certain fields in a SharePoint list item. Every time I try and input an array into the corresponding field, it automatically adds a 'Apply to Each' loop and the flow fails (see screenshots below for context)...
Apologies, this is likely a simple fix but I am an ammeter when it comes to variables. Really appreciate all help in advance!
Pls refer the below sample flow:
Here I have taken 'MultiChoiceCol' as a multichoice filed in SP list.
In "Apply to each" action (loop), add a "Select" action which will collect the values of multichoice field in a collection or array:
Next, in the update item action, pass the output of 'Select' action in the multichoice field value. First click 'Switch to input entire array' button:
and now pass the output of select action in the multichoice field value.
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Thanks
I know a guy on here that is a wizard of all things Power Automate and probably already knows how to do this..... @Nived_Nambiar ✅✅✅✅✅✅✅✅✅✅✅✅
@trice602, Hugely appreciative of your effort! Thank you. Keeping my fingers crossed someone can figure this out!
Hi @nathanisaacson ,
Thanks for sharing this. I understand the requirement now and don't know how to do that; as-in, update a multi-select column and retain previously selected values. I really wanted to solve this.
That said, I am hoping someone with this skillset can jump in here and provide the how-to. I am also going to follow along and learn myself.
In my example, the second "Apply to Each" is added when I add the "Risk Exposure Value" to the field in the "Update Item" action.
If I were to do what you did (i.e. adding each option manually to the "Update Item" action) everything would work. But the problem is: I need to carry over the selections that were already there and THEN add new options on top of that. Reference the below screenshot for a visual...
As you can see, I've placed the "Risk Exposure Value" in there (to carry over the previous selections) and then added new selections manually. But this results in the added "Apply to Each" and a flow failure.
Hi @nathanisaacson ,
This is my new multi-select choice column and it has three options: Choice 1, Choice 2, Choice 3.
In my Power Automate flow, I want to update every item (from Get Items) and add Choice 1 and Choice 2 to each.
In my example, I have one Apply to each and I was able to successfully update with more than one choice. One important note: The multi-select options are already predetermined in my List (I am not making them up in my flow, I am selecting them from my dropdown options).
In your screenshots, I don't see these as dropdowns. Please confirm your choice values are already created as options in your list.
Hi @nathanisaacson ,
Ok, brb. I will make my column multi-value and then add a couple of values. In my example, I will assume everything in the list needs a Choice 1 and Choice 2 and loop through the entire list.
Hi @trice602
My column is multi-value, which is probably why it doesn't have that drop-down in the "Update Item" action. If it were a single-value, I'd have no problem placing the "Risk Exposure Value" into that column in the "Update Item". I think the fact that it's technically an array is throwing it off.
The values that are included as part of the multi-choice column are: Associate Data Elements; Investor Data Elements; Corporate Data Elements; Investment, Transaction and Position Data Elements; IT Information.
Hi @nathanisaacson ,
Ok, this is where I am at. I added a choice column to one of my lists and this is what it looks like if I want to update my list items:
Is your choice column a single value or multiple value options? I am trying to rebuild this in a sample list here but can't make it look like yours. What is the value or values you want to update in RiskExposure?
In my sample list, I have a choice column named RiskExposure and has three options Choice 1, Choice 2, Choice 3, and only one can be selected.
Thanks for sharing. I'm going to dig into this now and hope others help and collaborate as well. Tom