cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
lui
Level: Powered On

Convert String/text to Array

Hello Team,

 

I'm transferring information from one list to another. I'm coming across an issue of converting from a text field to a choice column.

Here are the details:

Field A from List A = Single line of text
Field B from List B = Choice Column with multi selections

 

The string value from Field A in List A = "1, 2, 3"

 

How do i convert this field to an array so i can be read to the choice column (multi selections) in List B?

Thanks ahead

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Convert String/text to Array

Take a look at this blog post.  It walks through the whole process of how to update a choice field in SharePoint using Flow when starting with a delimited string.

https://veenstra.me.uk/2019/04/01/microsoft-flow-update-a-multi-select-choice-field-in-a-sharepoint-...



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: Convert String/text to Array

Use Split() based on ',' to convert the comma delimited string to an array.

split(stringvariable, ',')

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
lui
Level: Powered On

Re: Convert String/text to Array

@Pstork1 I did that but it doesnt select the items in the choice dropdown. Dont I have to create a step like initialize array variable? 

Dual Super User
Dual Super User

Re: Convert String/text to Array

You are in Flow, so there is no dropdown.  Are you asking how to build an array that you can pass back to Power Apps to set a dropdown value or how to build an array that you can use in an Update action to update a choice field in SharePoint?  Split() is how you convert the string to an array.  Depending on what you are doing with it you may need to make other changes.

 

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
lui
Level: Powered On

Re: Convert String/text to Array

im creating an item for a SharePoint list so the field is a choice column. As you can see on the screenshot, the column requires an array input. How do i move a text/string field to this choice column? I found a way to do it for a single selection, but it gets difficult when multiple selections happen. For example: "1, 2, 3"

 

Annotation 2020-01-18 092826.png

 

Annotation 2020-01-18 0928261.png

lui
Level: Powered On

Re: Convert String/text to Array

@Pstork1 Hope it makes sense, i can send more screenshots if you like.

Dual Super User
Dual Super User

Re: Convert String/text to Array

Take a look at this blog post.  It walks through the whole process of how to update a choice field in SharePoint using Flow when starting with a delimited string.

https://veenstra.me.uk/2019/04/01/microsoft-flow-update-a-multi-select-choice-field-in-a-sharepoint-...



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,537)