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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,348)