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

Split string into array of characters - empty delimiter not working

Trying to split a string into an array of characters, but using a delimiter of nothing '<empty>' does not work.  Any help would be appreciated.

 

Simple variable creation to test it out... 

 

Expression with empty delimiter:

array(split('testing',''))

Result:

[
  "testing"
]

With a delimiter:

array(split('testing','t'))

Result: (expected)

[
  "",
  "es",
  "ing"
]

 

Thanks in advance, and sorry if it is something simple I missed along the way.

6 REPLIES 6
Community Support Team
Community Support Team

Re: Split string into array of characters - empty delimiter not working

Hi @wdenny,

 

I did a test on my side, and the result of the expression output you provided is what you expected.

I am a bit confused about what kind of data you need to get.

65.PNG66.PNG

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
wdenny
Level: Powered On

Re: Split string into array of characters - empty delimiter not working

Ok, so you tested my second case, which was as expected.

 

The case I am trying to solve is with an empty delimiter.

 

So you would use: Split('testing','')

And you should recieve: ["t","e","s","t","i","n","g"]

 

split issue - input.PNGsplit issue - result.PNG

Community Support Team
Community Support Team

Re: Split string into array of characters - empty delimiter not working

Hi @wdenny,

 

I tested it on my side, and relying on the split() function doesn't seem to get the results you expected. Because such a separator seems to have no effect.

You could try other methods. I used variables and expressions on my side to get the results you want, maybe you could refer to.

74.PNG75.PNG

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: Split string into array of characters - empty delimiter not working

Hi @wdenny,

 

Have you tried the method I provided?

It seems that using the Split() function as you described does not produce the expected results.

If you need further assistance, please feel free let me know.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
wdenny
Level: Powered On

Re: Split string into array of characters - empty delimiter not working

Sorry for the delay, holidays you know! I have not tried the method you outlined. Mostly, as it is gigantic, and I feel like it would completely overbear the point of the flow. While my example used the word "testing" it is likely that these will be phrases for our content (e.g. "Now is the time for all good men to come to the aid of their country"). I was hoping to use this process to check for/replace reserved characters and words for SharePoint as we use these phrases to generate unique locations. I was really hoping to find something simple an elegant, where the error handling didn't dwarf the entire flow. Any chance we can log this somewhere w/ MSFT to get the split function fixed? It works correctly in every other product offering...
CGallardo1
Level: Powered On

Re: Split string into array of characters - empty delimiter not working

Hi Wdenny,

I had the same issue. I worked around this limitation as follows:

Define a String variable called Subject (My initial variable was a string that was taken from the subject line in an email.)

Define a second string variable called CommaSubject, set its value to replace each space with a comma i.e. replace(triggerBody()?['Subject'],' ',',')     Although it may be better to use a less common character such as ^ for the separator.

You can then split that string using the character you replaced.

 

Cristian

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 95 members 2,974 guests
Please welcome our newest community members: