Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Calculate number of days in the between approved and today.

(0) ShareShare
ReportReport
Posted on 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 at
    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 at
    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,614 Super User 2025 Season 1 on at
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow