cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
df97
Regular Visitor

Error when using Split function to Set a Variable

I am using Split, first & last to extract part of a string from one variable to set another variable.

 

- input from first variable named 'Content':

       This is a test string

       <test>

      Other text

 

- the second variable, initializes with the following expression for the value.

        First( Split( Last( Split(variables('Content'), '<' ) ).Result, '>' ) ).Result

 

The expected result is the string: test

Instead, the following error message is generated:

Unable to process template language expressions in action 'ATG_variable' inputs at line '1' and column '3380': 'The template language expression 'First( Split( Last( Split(variables('Content'), '<' ) ).Result, '>' ) ).Result' cannot be evaluated because property 'Result' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@df97

Remove .Result in both places and give it another try

 

 

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

Scott

View solution in original post

3 REPLIES 3
ScottShearer
Super User
Super User

@df97

Remove .Result in both places and give it another try

 

 

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

Scott

View solution in original post

Niding
Microsoft
Microsoft

Hi @df97

 

You can try without the ".Result" parts, for example with this formula: 

First(Split(Last(Split(variables('Content'), '<' ) ), '>' ) )

Hi Scott,

 

Thank you for the quick reply.

I updated the function to the following and it worked as expected:

First( Split( Last( Split(variables('Content'), '<') ) , '>') )
 
I will mark this as solved.
Thank you

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,877)