Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Suggested answer

Update SQL table from Sharepoint list with a multi-select combobox

(2) ShareShare
ReportReport
Posted on by 25
I have a flow that transfers a Sharepoint entry (from a powerapp form) to a SQL table. I need to use a multiselect box for "Region" and only the most recent selection is getting updated from the sharepoint list to the sql table. I googled the world about arrays but the approach below seems to be outdated?
 
 
 
 
  • Suggested answer
    Michael E. Gernaey Profile Picture
    40,272 Super User 2025 Season 1 on at
    Update SQL table from Sharepoint list with a multi-select combobox
     
    No you accidentally did hehe something i didnt say. 
     
    So lets go through what I said, so that I make sure its what lol i want.
     
    Let me state so that its clear. You have an Array, you need to turn it into a string to go into SQL. So you have to pre-loop the Region, create the string, THEN use that string in your Flow.
     
    1. leave the loop for Region but remove the actions you added to that loop
    You should have left Region there and remove Update row V2 as you haven't created the string yet.
     
     
    2. Concat them all together Comma separated in your flow
    -Create a string Variable call it RunRegions (perfect)
    -add an Apply to each but only for Region don't do anything else  <== here I said for Region (not RunRegion)
    -In  your Apply to each use Append to String action and do the below action
    ------concat(item(), ',')
     
    3. lastly lets remove the final , that will be at the end.
    --substring(variables('RunRegions'), 0, sub(length(variables('RunRegions')), 2))
     
    4. Now after your Region Apply to each in the Region field, but within the Outter Apply to each, put the name of your string Variable
    were the variable name is RunRegions
     
     
    So it will look like this
     
     
    So close hehe, let me know if you need more help
  • BP-02102142-0 Profile Picture
    25 on at
    Update SQL table from Sharepoint list with a multi-select combobox
    Thanks for the swift reply @Michael E. Gernaey, I'm getting close!  Here are my two results:
     
    1. get an array error: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@variables('RunRegions')' is of type 'String'. The result must be a valid array.
    2. change the variable to a Type: Array, but then both the SP list and SQL table show [].
    Any thoughts here? I'm sure I missed one simple step.
     
     
     
    and then....
     
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    40,272 Super User 2025 Season 1 on at
    Update SQL table from Sharepoint list with a multi-select combobox
     
    This is because you are looping through the "records" in Region, updating the same row 1-M times, with the last one always being the last selected Region.
     
    If you want to store them do this
     
    1. leave the loop for Region but remove the actions you added to that loop
    2. Concat them all together Comma separated in your flow
    -Create a string Variable call it RunRegions
    -add an Apply to each but only for Region don't do anything else 
    -In  your Apply to each use Append to String action and do the below action
    ------concat(item(), ',')
     
    3. lastly lets remove the final , that will be at the end.
    --substring(variables('RunRegions'), 0, sub(length(variables('RunRegions')), 2))
     
    4. Now after your Region Apply to each in the Region field, but within the Outter Apply to each, put the name of your string Variable
    were the variable name is RunRegions
     
    And you will have all 3 in there comma separated
     
    If this resolves your issue please mark the answer as such and maybe a like :-)
     
    Cheers
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,898 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow