Skip to main content
Community site session details

Community site session details

Session Id : MwYn1B9Y61zWZCJJwzRKLh
Power Automate - Building Flows
Unanswered

To calculate difference between today and date column in sharepoint list item

Like (0) ShareShare
ReportReport
Posted on 1 Apr 2024 13:45:21 by 295

I want to trigger outlook mails, when the sharepoint list item's expiry date column is in next 30 days or 15 days (basically difference between today and expiry date).
Firstly I got the all items using Get Items action, and In apply to each , I'm using condition and expression I have set here is 

div(sub(ticks(utcNow()),ticks(item()['ExpiryDate'])),864000000000).
The error what I'm getting is , Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language expression 'div(sub(ticks(utcNow()),ticks(item()['ExpiryDate'])),864000000000)' cannot be evaluated because property 'ExpiryDate' doesn't exist


 

  • v-yetonggu-msft Profile Picture
    on 01 Apr 2024 at 14:04:14
    Re: To calculate difference between today and date column in sharepoint list item

    Hi @apeawakening ,

    Please check out your 'ExpiryDate' Column Internal Name.

    For Example:

    My Next_action_date Column:

    vyetonggumsft_1-1711979567166.png

    When I changed its display name to 'ExpiryDate', its internal name was still 'Next_action_date'.

    vyetonggumsft_3-1711979813688.png

    Here are the steps to view the internal name of a column:

    vyetonggumsft_5-1711979928080.png

    vyetonggumsft_4-1711979851765.png

    vyetonggumsft_6-1711980069822.png

    When referencing the name of a column in an expression, reference the internal name of the column.

    In addition to this, you have some problems writing expressions, please use items('Apply_to_each') instead of item() in the Apply to each loop.

    Please try this expression:

     

    div(sub(ticks(utcNow()),ticks(items('Apply_to_each')['InternalName'])),864000000000)

     

    Best Regards,

    Sunshine Gu

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