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

Date Condition - Salesforce

Hi,

 

I am trying to create a flow to send me an email when CreateDate is 7 days old.    I have tried a variety of combinations but unable to get the syntax correct.


The date/time retrieved from salesforce is as follows:

2021-05-28T15:58:57Z

 

NiugeS_0-1622820431446.png

In the expression I currently have :

adddays(utcnow(),-7,'yyyy-MM-dd'

I have tried a number of attempts including formatdate etc but faliing. 

Any help appreciated as no idea where i'm going wrong.

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
v-LilyW-msft
Microsoft
Microsoft

Hi @NiugeS 

Thank you for your posting.

Because the two date formats are inconsistent, so please set the date format to the same and then use condition to judge.

You can refer to as bellow:

v-LilyW-msft_0-1623030055085.png

Expression:formatDateTime(outputs('Compose'),'yyyy-MM-dd')
Expression:adddays(utcnow(),-7,'yyyy-MM-dd') 

v-LilyW-msft_1-1623030075163.png

After Flow runs,will get the result.

v-LilyW-msft_2-1623030202377.png

Hope the content above may help you.
Best regards,

Lily

View solution in original post

4 REPLIES 4
v-LilyW-msft
Microsoft
Microsoft

Hi @NiugeS 

Thank you for your posting.

Because the two date formats are inconsistent, so please set the date format to the same and then use condition to judge.

You can refer to as bellow:

v-LilyW-msft_0-1623030055085.png

Expression:formatDateTime(outputs('Compose'),'yyyy-MM-dd')
Expression:adddays(utcnow(),-7,'yyyy-MM-dd') 

v-LilyW-msft_1-1623030075163.png

After Flow runs,will get the result.

v-LilyW-msft_2-1623030202377.png

Hope the content above may help you.
Best regards,

Lily

View solution in original post

@v-LilyW-msft Thank you for the assistance.  I will look at following the above and come back to confirm!  Many thanks!

v-LilyW-msft
Microsoft
Microsoft

Hi @NiugeS 

Has your problem been solved?

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

Best Regards!

NiugeS
Helper I
Helper I

@v-LilyW-msft Apologies for the delay - yes this assisted.  Thank you!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Kudoed Authors
Users online (2,084)