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 : G4ctjQU2+yyUU1+6InHYgs
Power Automate - Using Flows
Answered

Calculate number of days in the between approved and today.

Like (0) ShareShare
ReportReport
Posted on 21 Jul 2021 17:24:42 by 11

I am trying to find out how many days old from the Approved Date Column I have renamed the column to Approved_Date and it is still not working. It used to be named Approved On... I was not sure if the space was the issue.  However, the below is not working in a compose once I get it working, I will set it to a variable I can read to see if it is past X number of days old.

 

div(sub(ticks(formatDateTime(utcNow(),'yyyy-MM-dd')),ticks(item()?['Approved_Date'])),864000000000)

 

What am I doing wrong...? it was working in the past and now that I am having to point it at a new folder, I am having issues getting it working.  How do I see the name of a column? like if the name was Approve On - I seem to recall seeing some strange numbers representing the space...

 

 

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '25742': 'The template language function 'ticks' expects its parameter to be a string that represents a timestamp. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#ticks for usage details.'.

  • Verified answer
    NathanStanford Profile Picture
    11 on 26 Jul 2021 at 11:24:29
    Re: Calculate number of days in the between approved and today.

    I deleted my flow and rewrote it and when I used - 

    div(sub(ticks(formatDateTime(utcNow(),'yyyy-MM-dd')),ticks(item()?['ApprovedOn'])),864000000000)
    it worked fine this time.  I am not sure what was the real issue but I have fixed it.
  • v-bofeng-msft Profile Picture
    on 26 Jul 2021 at 07:57:05
    Re: Calculate number of days in the between approved and today.

    Hi @NathanStanford :

    According to the error message, it can be inferred that the value of item()?['Approved_Date'] in your formula is null, please consider sharing your flow to us.(It's better to have some screenshots and other details)

    Best Regards,
    Bof

  • Mitanshu Profile Picture
    1,635 Moderator on 21 Jul 2021 at 20:27:00
    Re: Calculate number of days in the between approved and today.

    It looks like that in your div(sub(ticks formula, the Approved_Date that you are putting is not the internal name used by SharePoint/PowerAutomate for your column.

     

    Assuming your data-source is SharePoint List.

    If you go to List Settings, and then scroll to bottom half of the page, you will see all columns listed.

     

    Now click on your column Approved_Date (or ApprovedOn or some similar name).

     

    On the new webpage that opens, the URL will end with parameter &Field=INTERNALCOLUMNNAME

     

    This INTERNALCOLUMNNAME is what you should put in Power Automate for your formula.

     

    I have not checked if the formula is correct, but a good starting thing to verify is whether internal name used by SharePoint List is same that is being used in your div(sub(ticks formula ... 

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

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

Featured topics

Restore a deleted flow
Loading complete