Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Formatting an Array to Place in SharePoint List Item

(1) ShareShare
ReportReport
Posted on by

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)...

 

2023-08-29_8-58-59.png

Inked2023-08-29_8-59-24.jpg

2023-08-29_8-58-09.png

 

Apologies, this is likely a simple fix but I am an ammeter when it comes to variables.  Really appreciate all help in advance!

  • ManishSolanki Profile Picture
    ManishSolanki 15,075 on at
    Re: Formatting an Array to Place in SharePoint List Item

    Hi @nathanisaacson 

     

    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:

    ManishSolanki_0-1693539428713.png

    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:

    ManishSolanki_1-1693539583485.png

    and now pass the output of select action in the multichoice field value.

    ManishSolanki_2-1693539726371.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

     

  • trice602 Profile Picture
    trice602 11,640 on at
    Re: Formatting an Array to Place in SharePoint List Item

    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 âœ…✅✅✅✅✅✅✅✅✅✅✅

     

     

  • Re: Formatting an Array to Place in SharePoint List Item

    @trice602, Hugely appreciative of your effort!  Thank you.  Keeping my fingers crossed someone can figure this out!

  • trice602 Profile Picture
    trice602 11,640 on at
    Re: Formatting an Array to Place in SharePoint List Item

    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.

     

     

  • Re: Formatting an Array to Place in SharePoint List Item

    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.

     

    2023-08-29_8-58-59.png

     

    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...

     

    2023-08-31_18-51-58.png

     

    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.

  • trice602 Profile Picture
    trice602 11,640 on at
    Re: Formatting an Array to Place in SharePoint List Item

    Hi @nathanisaacson ,

     

    This is my new multi-select choice column and it has three options:  Choice 1, Choice 2, Choice 3.

     

    trice602_0-1693532208775.png

     

    In my Power Automate flow, I want to update every item (from Get Items) and add Choice 1 and Choice 2 to each.

     

    trice602_1-1693532269210.png

     

    trice602_2-1693532337391.png

     

    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.

     

     

     

  • trice602 Profile Picture
    trice602 11,640 on at
    Re: Formatting an Array to Place in SharePoint List Item

    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.

     

     

  • Re: Formatting an Array to Place in SharePoint List Item

    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.

  • trice602 Profile Picture
    trice602 11,640 on at
    Re: Formatting an Array to Place in SharePoint List Item

     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:

     

    trice602_0-1693530849814.png

     

    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.

     

    trice602_1-1693531392529.png

     

  • trice602 Profile Picture
    trice602 11,640 on at
    Re: Formatting an Array to Place in SharePoint List Item

    Thanks for sharing.  I'm going to dig into this now and hope others help and collaborate as well.  Tom

     

     

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