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 / Need help with new flo...
Power Automate
Answered

Need help with new flow - one of my dates is not showing correctly

(0) ShareShare
ReportReport
Posted on by 99

Hi  i had a similar issue with one of my other flows and was giving a formula to add into the expresiion tab, the formula worked a treat, so i built another flow and thought i could do same but its working for return date  but no leave date

My Flow

Dougers1_0-1696501717406.png

 

Dougers1_2-1696501751015.png

 formula for leave date 

formatDateTime(items('Apply_to_each')?['Return date'], 'dd-MM-yyyy')
 
 
what do i need to do ?
Categories:
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @Dougers1 

     

    Did you try changing the column name 'Leave date' in the expression:

    formatDateTime(items('Apply_to_each')?['Leave date'], 'dd-MM-yyyy')

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Dougers1 Profile Picture
    99 on at

    yeah  changed that to leave date  and still failed - it looks like it not saving  because when i go back to check its blank

    Dougers1_0-1696504968776.png

     

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @Dougers1 

     

    Pls share the error details with screenshot if flow breaks. If flow runs successfully, then pls check the field's name from the output of List rows present in a table action in last run instance. Replace the exact field name in the expression shared in the previous reply.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

  • Dougers1 Profile Picture
    99 on at

    this is the error i get 

     

    Dougers1_0-1696511667644.png

    also get emailed this

    Flow Run Failure: One or more fields provided is of type 'Null'.
    Staffbank Annual leave started experiencing issues at 13:04 ,10/5/2023 UTC

    What happened?
    One or more fields provided is of type 'Null', a different type is expected.

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    @Dougers1 check out my post about Excel dates and blank fields and the solution.

     

    Basically you will have to change the List Rows Present in a Table to Date type Serial and then use an expression like this.

    if(empty(item()?['Birth Date']),null,addSeconds('1899-12-30',int(formatNumber(mul(float(item()?['Birth Date']),86400),'0'))))

    but you will need to wrap the last addSeconds part in a formatDateTime() since my example was getting an output of DateTime, but you are wanting a string.

    if(empty(item()?['Birth Date']),null,formatDateTime(addSeconds('1899-12-30',int(formatNumber(mul(float(item()?['Birth Date']),86400),'0'))),'dd-MM-yyyy'))
  • Dougers1 Profile Picture
    99 on at

    Sorry im new and dont understand - this worked in my other flow and that was set up the same. when i change the leave date to dynamic

    Dougers1_0-1696534573560.png

     

    i get this email

    Good News David

    Your annual leave has been processed, leave requested - 2023-09-21T00:00:00.000Z to 21-09-2023 for 22.3 Hours

    Your new balance is now 35 hours

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Yes, if you used all Dynamic Content options in the email, you wouldn't get any errors.

     

    The error was due to a blank date value. The function formatDateTime() was trying to format the blank/null and created an error.

     

    So you will have to adjust the expression so it can deal with a blank value.

     

    And like @ManishSolanki said above, make sure the name is correct in the expression. There is a difference between "Leave date" and "Leave Date" since the "d-D" are different capitalized and lowercase.

  • Dougers1 Profile Picture
    99 on at

    i have tried this

    Dougers1_0-1696536026424.png

     

    I added the second formula and changed birth date to Leave date

    if(empty(item()?['Birth Date']),null,formatDateTime(addSeconds('1899-12-30',int(formatNumber(mul(float(item()?['Birth Date']),86400),'0'))),'dd-MM-yyyy'))

    Dougers1_3-1696536384262.png

     

    my email now  comes back as below missing the leave start date

    Your annual leave has been processed

    Leave Date Start:

    Leave Date End: 21-09-2023

    Annual leave hours approved 22.3

    Your new balance is now 35 hours

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Are there any blank fields in the workbook table?

     

    Also, if you are using my formula, you need to change the dropdown option for DateTime Format to be Serial.

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Can you check the column headings in your workbook for any leading spaces.

     

    From your screenshot it appears that the dynamic content "Leave date" is further right than the dynamic content of Hours Requested.

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 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard