cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Split Function on a Control Data Type

I am trying to split the contents of a text input field using the following formula: Split(TextInput2.Text,"-"). This is generating an "Expected Text Value" error. I have tried multiple way to attempt to convert the table value to text to no avail. Any help anyone can provide would be much appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
zmansuri
Super User
Super User

a2.jpg

Right(TextInput2.Text,Find("-",TextInput2.Text))

 

This will find where - is. And give you the string after it.

View solution in original post

8 REPLIES 8
DylanSimons
Resolver III
Resolver III

The result of a Split() is a Table. Are you trying to display this split in a label or some other type of textbox? If so you need to get the first or last value like this:

 

First(Split(TextInput2.Text,"-")) or Last(Split(TextInput2.Text,"-"))

 

Is this what you want to show?

Anonymous
Not applicable

Yes. In this case I want to show last.

zmansuri
Super User
Super User

Concat(Split(Text(TextInput2.Text),"-"),
Result & Char(13)
)

Anonymous
Not applicable

It is still getting the error that the data type is "control".

Anonymous
Not applicable

OK. We're making progress! Thanks so much for the help. Using this formula (Concat(Split(Text(TextInput2_1.Text),"-"), Result & Char(13))) I am able to split the text POE-DGI and getting both values in the text label as:

 

POE

DGI

 

Now I need to get the last value.

If you just want to show the last one it would be:

Last(Split(TextInput2.Text,"-")).Result

zmansuri
Super User
Super User

a2.jpg

Right(TextInput2.Text,Find("-",TextInput2.Text))

 

This will find where - is. And give you the string after it.

Anonymous
Not applicable

That worked. Thank you!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,583)