web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Null Value Date Time C...
Power Automate
Unanswered

Null Value Date Time Conversion SharePoint list

(0) ShareShare
ReportReport
Posted on by

 

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

 

Categories:
I have the same question (0)
  • Gristy Profile Picture
    2,429 on at

    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 Profile Picture
    on at

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

  • Gristy Profile Picture
    2,429 on at

    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 🙂

  • Verified answer
    CindyZ Profile Picture
    on at

    @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-display-as-MM-dd-yyyy/m-p/420210#M35342

  • et1mark Profile Picture
    9 on at

    I'm parsing incoming emails but having trouble with null values as I write to a sharepoint list.  I'm sure I'm on the right track after reading about "if(empty(" but i'm unsure how to modify my expression below.  I've got multiple fields with dates or numbers that I'd like to use but I'm stuck letting Sharepoint list convert it to text.

     

    trim(first(split(last(split(variables('newLines'),'*Surgery Date:')),'*Laser Serial Number:')))

  • et1mark Profile Picture
    9 on at

    As soon as I post, I had some luck.  This worked at least for the first try.  But what an awful long expression...

     

    if(empty(trim(first(split(last(split(variables('newLines'),'*Surgery Date:')),'*Laser Serial Number:')))),null,trim(first(split(last(split(variables('newLines'),'*Surgery Date:')),'*Laser Serial Number:'))))

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard