cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
R_KW
Helper I
Helper I

DateDiff in Power Automate is a String?

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!

 

1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @R_KW ,

 

Convert the variable using the formatDateTime() function 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Nogueira1306
Super User
Super User

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

Hi @Nogueira1306 

 

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

R_KW_0-1628151612280.png

 

@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);

Thx! It works

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,839)