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: The t...
Power Automate
Answered

InvalidTemplate: The template language function expects its first parameter to be of type string.

(0) ShareShare
ReportReport
Posted on by 14
Hi, 
 
I have designed this flow so when a Plumsail form is filled out it gets generated into a pdf and sent to an email address. 
 
The flow was successfully working for two days and then I started to receive the following:
InvalidTemplate. Unable to process template language expressions in action 'Start_document_generation_process_with_json' inputs at line '0' and column '0': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'
 
As you can see I have tried to set an 'Initialize Variable' but it has not worked.
 
There is multiple dates to fill out throughout the form so I am thinking the issue lies within that.
 
Any help is much appreciated.
 
 
 
 
 
Categories:
  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at
     
    It might not even be related to your EOWD variable. Because it is referring to the formatdatetime function within your Start document action.
     
    I see you are using a formatdatetime function for the Mon.Date property. Can you share the expression you used over there?
     
    The error suggest you are using an empty value in the first parameter of that function and it is failing because of that.
  • VB-08010839-0 Profile Picture
    14 on at
     
    Thanks for reaching out. The expression for Mon.Date is - formatDateTime(triggerOutputs()?['body/Mon.Date'],'D')
     
    I have been using this expression for each of the dates within the template data.
  • Verified answer
    Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at
     
    It might have an issue with the field name, specifically the '.' (dot character) between Mon & Date.
     
    Normally that is interpreted as a reference to a separate nested field in expression language. In other words, it might think you are looking for the below: 
    triggerOutputs()?['body/Mon/Date']
    And that field doesn't exist.
     
    Do you have the option to rename the Mon.Date field to a name without a dot?



    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, Bluesky profile or Youtube Channel
  • VB-08010839-0 Profile Picture
    14 on at
     
    This has worked perfectly and now my flows are running.
     
    Thanks very much for your help!!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard