cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bsmith736464
Helper I
Helper I

Template Validation Failure: Trim and Apply to Each

I have tried to incorporate a trim action into my flow but when I go to save it, I get the following error:

 

"The template validation failed: 'The inputs of template action 'Trim_Last_Name' at line '1 and column '5405' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Trim_Last_Name' to be referenced by 'repeatItems' or 'items' functions.'."

 

My trim expressions are:

trim(items('Apply_to_each')?['LastName'])

trim(items('Apply_to_each')?['FirstName'])

 

Any help would be greatly appreciated.

 

Screen Shot 2020-02-16 at 4.48.18 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @bsmith736464,

 

The problem you met in the Flow is that when you are using the items() function inside in the Apply to each action, the parameter should be the same name with the action name, so you should rename the expression, for example:

-trim(items('Apply_to_each_4')?['LastName'])

-trim(items('Apply_to_each_4')?['FirstName'])

 

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

View solution in original post

1 REPLY 1
v-litu-msft
Community Support
Community Support

Hi @bsmith736464,

 

The problem you met in the Flow is that when you are using the items() function inside in the Apply to each action, the parameter should be the same name with the action name, so you should rename the expression, for example:

-trim(items('Apply_to_each_4')?['LastName'])

-trim(items('Apply_to_each_4')?['FirstName'])

 

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

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (4,257)