Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Convert String/text to Array

Like (0) ShareShare
ReportReport
Posted on 18 Jan 2020 13:46:15 by 178

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

 

  • ComputerHabit2 Profile Picture
    on 27 Sep 2021 at 12:56:59
    Re: Convert String/text to Array

    I reposted in forum.  I was having a moment last Friday.  To much repetition for testing and trying and no results.

    Solved: Re: Convert a string to array - Power Platform Community (microsoft.com)

     

    The answer here seemed more what I was looking for.   

  • Pstork1 Profile Picture
    66,079 Most Valuable Professional on 25 Sep 2021 at 11:32:00
    Re: Convert String/text to Array

    You wouldn't split on the spaces.  You would split on the commas.

  • ComputerHabit2 Profile Picture
    on 24 Sep 2021 at 22:17:45
    Re: Convert String/text to Array

    I tried following the details and it doesn't work for me.  Split doesn't work for me.  I guess for my string there are spaces and so on.  THere isn't enough detail in the linked article to tell me the proper parts to use.  Help.

  • Verified answer
    Pstork1 Profile Picture
    66,079 Most Valuable Professional on 19 Jan 2020 at 02:55:03
    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-list/

  • lui Profile Picture
    178 on 18 Jan 2020 at 14:41:09
    Re: Convert String/text to Array

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

  • lui Profile Picture
    178 on 18 Jan 2020 at 14:33:45
    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

  • Pstork1 Profile Picture
    66,079 Most Valuable Professional on 18 Jan 2020 at 14:26:29
    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.

     

     

  • lui Profile Picture
    178 on 18 Jan 2020 at 14:22:31
    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? 

  • Pstork1 Profile Picture
    66,079 Most Valuable Professional on 18 Jan 2020 at 14:16:06
    Re: Convert String/text to Array

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

    split(stringvariable, ',')

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard