Skip to main content

Notifications

Power Automate - Using Flows
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.
 
 
 
 
 
  • VB-08010839-0 Profile Picture
    VB-08010839-0 14 on at
    InvalidTemplate: The template language function expects its first parameter to be of type string.
     
    This has worked perfectly and now my flows are running.
     
    Thanks very much for your help!!
  • Verified answer
    Expiscornovus Profile Picture
    Expiscornovus 31,081 on at
    InvalidTemplate: The template language function expects its first parameter to be of type string.
     
    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
    VB-08010839-0 14 on at
    InvalidTemplate: The template language function expects its first parameter to be of type string.
     
    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.
  • Expiscornovus Profile Picture
    Expiscornovus 31,081 on at
    InvalidTemplate: The template language function expects its first parameter to be of type string.
     
    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.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard

Featured topics

Restore a deleted flow