cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CindyZ
Level: Powered On

Null Value Date Time Conversion SharePoint list

 

I am trying to convert a date so that I can have it show up in my email.  The date originates in a SharePoint list and is in a PowerApp.  I'm showing the detail in the below images from only two attempts I've made, but I've tried this no less than 50 times, 20+ different ways, by following suggestions (many different from the other) in this forum and still not showing as resolved in many cases.  I cannot see what step I'm missing or where the failure is occurring. 

 

I get this message every time. 
Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2810': 'The template language function 'formatdatetime' expects its first parameter to be of type string. The provided value is of type 'Null'.

Here's hoping someone will see the obvious and help me get out of this time consuming rabbit hole I'm in.  Thanks so much.    

 

Slide1.JPG

 

 

Slide2.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
CindyZ
Level: Powered On

Re: Null Value Date Time Conversion SharePoint list

@Gristy Thanks again for your help.  I was still not able to understand what you were proposing but it did lead me down lots of helpful paths and to more learning about trigger body so your suggestion was still beneficial. 

I finally found this solution that worked well for me which I'm sharing here in case someone else is not able to overcome their own limitations with your excellent guidance.  https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-format-date-value-in-email-body-to...

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Null Value Date Time Conversion SharePoint list

Hello,

 

1) use it from your "GET ITEM" not Trigger body as the trigger body maybe it is null (it is or you would not get error).

2) you can not get the error by doing this type of expression it does not format the date if there is not one:

 

if(empty(triggerBody()?['StartDate']),'',formatDateTime(triggerBody()?['StartDate'],'dd-MM-yyyy'))
CindyZ
Level: Powered On

Re: Null Value Date Time Conversion SharePoint list

@Gristy, thanks so much but I do not understand what you mean about the Get Items.  

Super User
Super User

Re: Null Value Date Time Conversion SharePoint list

you have the trigger for selected item

you then have the action get item

 

you are showing us the date value from get item

you are using the date value from for selected item (which is null)

 

hopefully that helps make sense for you 🙂

Highlighted
CindyZ
Level: Powered On

Re: Null Value Date Time Conversion SharePoint list

@Gristy Thanks again for your help.  I was still not able to understand what you were proposing but it did lead me down lots of helpful paths and to more learning about trigger body so your suggestion was still beneficial. 

I finally found this solution that worked well for me which I'm sharing here in case someone else is not able to overcome their own limitations with your excellent guidance.  https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-format-date-value-in-email-body-to...

View solution in original post

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,355)