cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RodM
Helper III
Helper III

Flows suddenly failing - Add hours function

Syntax:
formatDateTime(addHours(outputs('Compose'),-4),'MM/dd/yyyy HH:mm')
 
I'm using this function to subtract time from Microsoft Forms responses to match local time. My flow worked flawlessly up until 10 minutes ago when there have been several failures due to the error below. I believe the description is saying my syntax is incorrect.
 
Please help!
 
Error:
Flow Run Failure: One or more fields provided is of type 'Null'.
 
InvalidTemplate. Unable to process template language expressions in action 'Add_a_row_into_a_table' inputs at line '1' and column '16902': 'The template language function 'addHours' expects its first parameter to be a string that contains the time. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#addhours for usage details.'.
1 ACCEPTED SOLUTION

Accepted Solutions
RodM
Helper III
Helper III

Please ignore. It seems Microsoft was having issues because its now resolved itself with no changes.

 

View solution in original post

3 REPLIES 3
RodM
Helper III
Helper III

Please ignore. It seems Microsoft was having issues because its now resolved itself with no changes.

 

efialttes
Super User
Super User

Hi!

The problem seems to be... outputs('Compose') is null i.e. empty.

So you need to check which value is currently assigned to your 'Compose' action block.Assuming you assigned a Forms response to it, it means somebody did not answer the question, and you get a null value instead of a date modelled as a string in ISO 8601 format.

So, either you mark the question as mandatory, or you add extra logic to replace null and handle a default date instead.

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Yes, the issue was traced to the Microsoft Forms server.

All fields on the form are required (not optional). Downloading the Excel sheet with the response data, those entries are gone. There are 17 response IDs missing.

Helpful resources

Announcements
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.

Users online (4,961)