web
Youโ€™re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : CTYYaTAHNwleUhDfauNQiG
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 5 Oct 2023 10:33:51 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 ?
  • Verified answer
    Dougers1 Profile Picture
    99 on 05 Oct 2023 at 20:40:59
    Re: Need help with new flow - one of my dates is not showing correctly

    It was the spread sheet that had a blank space before Leave date , it now working perfect thank you very          much ๐Ÿ™‚

  • wskinnermctc Profile Picture
    6,517 Moderator on 05 Oct 2023 at 20:31:44
    Re: Need help with new flow - one of my dates is not showing correctly

    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.

  • wskinnermctc Profile Picture
    6,517 Moderator on 05 Oct 2023 at 20:30:05
    Re: Need help with new flow - one of my dates is not showing correctly

    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.

  • Dougers1 Profile Picture
    99 on 05 Oct 2023 at 20:11:39
    Re: Need help with new flow - one of my dates is not showing correctly

    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,517 Moderator on 05 Oct 2023 at 19:42:07
    Re: Need help with new flow - one of my dates is not showing correctly

    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 05 Oct 2023 at 19:36:39
    Re: Need help with new flow - one of my dates is not showing correctly

    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,517 Moderator on 05 Oct 2023 at 14:59:32
    Re: Need help with new flow - one of my dates is not showing correctly

    @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 05 Oct 2023 at 13:15:24
    Re: Need help with new flow - one of my dates is not showing correctly

    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.

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 05 Oct 2023 at 12:33:18
    Re: Need help with new flow - one of my dates is not showing correctly

    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 05 Oct 2023 at 11:19:50
    Re: Need help with new flow - one of my dates is not showing correctly

    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

     

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

Telen Wang โ€“ Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Communityโ€ฆ

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful forโ€ฆ

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete