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 Apps / DateDiff in Power Auto...
Power Apps
Answered

DateDiff in Power Automate is a String?

(0) ShareShare
ReportReport
Posted on by 80

Hi all,

 

I am using PowerApps in Teams and I created a Power Automate to change the field value if the selected date is smaller than today.

PowerAppsDay1.Run(DateDiff(Today(),DateValue(Gallery6.Selected.'Join Date')),LookUp(Progress_Table,Name=Chosen,'Day 1'),Chosen);

R_KW_0-1628150472199.png

R_KW_1-1628150570031.png

Here's the result. It became String, even if I added Int() to it.

 

Any idea how to fix it? Thanks!

 

Categories:
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @R_KW ,

     

    Convert the variable using the formatDateTime() function 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Hey! Try this:
    Initialize a var of type string and set it for the the item from power apps.

    Then, Initialize another var of type int and set it to Int( THE VAR YOU CREATED BEFORE)

     

    So you can force it

     

    Try it and tell me something

  • R_KW Profile Picture
    80 on at

    Hi @Nogueira1306 

     

    Thx for responding! But it didn't work well. 

    R_KW_0-1628151612280.png

     

  • Verified answer
    Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    @R_KW if it does not work you can try this in Power Apps:

     

    PowerAppsDay1.Run(Value(DateDiff(Today(),DateValue(Gallery6.Selected.'Join Date'))),LookUp(Progress_Table,Name=Chosen,'Day 1'),Chosen);
  • R_KW Profile Picture
    80 on at

    Thx! It works

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 Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard