cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RBS1995
Helper I
Helper I

FormatDateTime expects its first parameter to be of type string. The provided value is of type 'Null'.

I am making a flow that works alongside with a form and I am wanting to change the date format to UK. I have used a initialized variable with the expression:

formatDateTime(outputs('Get_response_details')?['body/r2a267e10d4824e58aa9b5b854a466a26'],'dd-MM-yyyy')

 

When running the flow, I receive this message letting me know it has failed:

Unable to process template language expressions in action 'Initialize_variable_2' 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'.

 

This is the code for the initialize variable for reference

Capture.JPG
What am I doing wrong for this not to work?
4 REPLIES 4
okeks
Super User
Super User

This message means that outputs('Get_response_details')?['body/r2a267e10d4824e58aa9b5b854a466a26'] doesn't have any value as an Output.

Can you show us the output of this action?

RBS1995
Helper I
Helper I

I am wanting to use the output in an email and Planner task.

The variable 3 is the same expression essentially but using another response instead.

RBS1995_0-1661245587089.png

 

okeks
Super User
Super User

The source of the problem is the input to the Initialize Variable 2 action, so we will need to see where the input comes from.

RBS1995
Helper I
Helper I

I peeked code at the email template as it had "date from" as a form response previously but was stating it in US format.

I peeked code to find the response ID for that question and inserted it into the formatdatetime expression above.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,916)