web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / [SOLVED] Invalid Templ...
Power Automate
Unanswered

[SOLVED] Invalid Template Error using Switch Action

(0) ShareShare
ReportReport
Posted on by 9

Hi!

 

I'm creating a flow to automatically trigger when a specific response is selected in an MS form, it will create a specific PDF based on the responses to send as an attachment via email to the respondent and specific individuals. I've successfully done this using the condition action and this was the flow I created that works!

Successful flow using the Condition action.Successful flow using the Condition action.

 

I wanted to create the same flow but for a different form but instead of 2 cases where I used the condition action, I would like it for 5 cases and I am attempting to use the switch action. I built the form essentially the same exact way expect for swapping out the condition for the switch action for the 5 different cases. However, when executing the flow, case 1 is successful but case 2 isn't. 

Case #1 is successful!Case #1 is successful!Case #2 fails.Case #2 fails.

 

The error displayed in Case #2 is when it goes to create a file, it doesn't read the compose outputs so it fails. 

Unable to process template language expressions in action '2._Create_file_as_html' inputs at line '0' and column '0': 'The template language expression 'outputs('2._Compose_filename')?['$']' cannot be evaluated because property '$' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.Unable to process template language expressions in action '2._Create_file_as_html' inputs at line '0' and column '0': 'The template language expression 'outputs('2._Compose_filename')?['$']' cannot be evaluated because property '$' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

What is weird to me is that it worked for Case #1 and they are built exactly the same. I haven't tested the other cases yet to see if they are successful or if they fail as I figured that they might fail similarly to Case #2. 

 

My knowledge of coding is very limited and I've spent a few hours trying to troubleshoot this myself without any success! If anyone could help a girl out - I would very much appreciate it 🙂 

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at
    Re: Invalid Template Error using Switch Action

    Hi @charisseregina 

     

    Could you pls share the screenshot(s) of the actions before create file in edit mode? 

     

    Thanks

  • charisseregina Profile Picture
    9 on at
    Re: Invalid Template Error using Switch Action

    Of course! Here are all the actions before the create file action in the error screenshot:

    Edit Mode ViewEdit Mode View

    Not pictured are the actions listed in Case #1 but it the same actions in the same order listed in the first screenshot of the OG post where the flow is working with the 2 cases/conditions. 

  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at
    Re: Invalid Template Error using Switch Action

    Hi @charisseregina 

     

    Pls reset the file name & file content parameters in create file action. Those should be chosen from the dynamic content as shown below:

    ManishSolanki_0-1699945079103.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • charisseregina Profile Picture
    9 on at
    Re: Invalid Template Error using Switch Action

    I've done that multiple times. Every time I save and then proceed to run the test, it goes back to the "$." Do you recommend that I recreate the flow from scratch to see if it truly resets the parameters? 

  • charisseregina Profile Picture
    9 on at
    Re: Invalid Template Error using Switch Action

    I did this and it worked. LOL. 

    All that comes to my mind now is... 

    a9105ptv1ti31

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard