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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / InvalidTemplate - When...
Power Automate
Answered

InvalidTemplate - When form field is empty

(0) ShareShare
ReportReport
Posted on by 25

Hi there,

 

I have a flow that is based on the details inputed into an MS Form, which contains a process to switch date format from American to UK, but it doesn't work when one of the dates is skipped (as it's optional to complete). 

 

The date goes through the process of initilising the variable, splitting it, then concating it (if concating is the real word for it) and the process always fails at the concat stage then stops the remainder of the flow from running, and it seems to be because this particular date field is empty.

 

I've tried to place a condition, but it won't let me as the initilaise function cannont be used in conditions, and I've tried to input an IF statement, but I can't get it to accept that sometimes that field will be sometimes blank.

 

Anybody got any idea on how to stop this failing?

 

This is how it's set up, expressions are:

 

split(variables('Employment Start Date'), '-')

 

concat(outputs('Split_(Employment_Start_Date)')[2],'-',outputs('Split_(Employment_Start_Date)')[1],'-',outputs('Split_(Employment_Start_Date)')[0])

 

This is how the problematic section is set upThis is how the problematic section is set up

 

 

This is how a failed run looks...

 

This is what a failed run of it looks likeThis is what a failed run of it looks like

Categories:
I have the same question (0)
  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Try

     

    if(empty(variables('Employment Start Date')),'',concat(outputs('Split_(Employment_Start_Date)')[2],'-',outputs('Split_(Employment_Start_Date)')[1],'-',outputs('Split_(Employment_Start_Date)')[0]))

  • KhaliqAhmed Profile Picture
    25 on at

    Thanks Sudeep!  That worked a treat 🙂 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard