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.

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,174)