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 IF Pro...
Power Automate
Answered

InvalidTemplate IF Problem

(0) ShareShare
ReportReport
Posted on by 46

This is probably so obvious and probably why I am missing it, but this keeps failing telling me I only have 2 of the 3 components of the IF function. This function is in a Set Variable for a String variable.

 

if(
equals(items('Roadmaps_-_Add_or_Update_Existing_Items')?['Short description2'],'Go-Live'),
formatDateTime(items('Roadmaps_-_Add_or_Update_Existing_Items')?['Planned Start Date'], 'MM/dd/yyyy'),
formatDateTime(items('Roadmaps_-_Add_or_Update_Existing_Items')?['Actual Start Date'], 'MM/dd/yyyy')
)

 

Error message: 

InvalidTemplate. Unable to process template language expressions in action 'Set_variable' inputs at line '0' and column '0': 'The template language function 'if' expects three parameter: the condition to test as the first parameter, the value to return if the condition is true as the second parameter, and the value to return if the condition is false as the third parameter. The function was invoked with '2' parameter(s)

Categories:
  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @jmfillman 

     

    Could you please tell me:

    Is your data source SharePoint? Is Short description2 a text column? 

    It doesn't look like there is an obvious problem with your formula. 

    You can try removing the spaces between the names when referencing the column names: 

    if(
    equals(items('Roadmaps_-_Add_or_Update_Existing_Items')?['Shortdescription2'],'Go-Live'),
    formatDateTime(items('Roadmaps_-_Add_or_Update_Existing_Items')?['PlannedStartDate'], 'MM/dd/yyyy'),
    formatDateTime(items('Roadmaps_-_Add_or_Update_Existing_Items')?['ActualStartDate'], 'MM/dd/yyyy')
    )

     

    Best Regards,

    Levi

  • jmfillman Profile Picture
    46 on at

    Thank you for the reply!

     

    The flow is reading from and Excel table trying to put the data into SharePoint.

     

    Short description2 is a text column,  in the Excel table.

  • Verified answer
    v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @jmfillman 

     

    Could you please tell me if I have solved your problem?

     

    Best Regards,

    Levi

  • jmfillman Profile Picture
    46 on at

    I tried various changes to the spacing, and found one that worked. Not sure of the why as it seems to not match a particular pattern, but did get it to work.

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
11manish Profile Picture

11manish 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard