cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
s1hl3_ukuvuma
Frequent Visitor

Default Date with Priority checkbox

Hi there,

 

I would like to use a checkbox control to prioritize a Target date value. The default value is:
If(Form_New,Text(DateAdd(Today(),30),DateTimeFormat.ShortDate),Form_Record.TargetCompletionDate)
This will add 30 days to Today's date and return a Target Completion Date.


Now I would like to add only 7 days instead of 30, when the priority checkbox is checked:
If(Form_New && Priority_value.Value ,Text(DateAdd(Today(),7),ShortDate),Form_Record.TargetCompletionDate)

How do I know combine the two in my default date property?
Thank You

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User III
Super User III

@s1hl3_ukuvuma 

Try this:

If(Form_New,Text(DateAdd(Today(),If(Priority_value.Value, 7, 30)),DateTimeFormat.ShortDate),Form_Record.TargetCompletionDate)

Hope this helps.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

I did it this way: If(Form_New && Priority_value.Value ,Text(DateAdd(Today(),7),ShortDate),If(Form_New,Text(DateAdd(Today(),30),ShortDate),Form_Record.TargetCompletionDate)) the priority value will only be selectable on s1 when it is editable, hence && in terms of the concept your solution is great. Thanks

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

@s1hl3_ukuvuma 

Try this:

If(Form_New,Text(DateAdd(Today(),If(Priority_value.Value, 7, 30)),DateTimeFormat.ShortDate),Form_Record.TargetCompletionDate)

Hope this helps.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

I did it this way: If(Form_New && Priority_value.Value ,Text(DateAdd(Today(),7),ShortDate),If(Form_New,Text(DateAdd(Today(),30),ShortDate),Form_Record.TargetCompletionDate)) the priority value will only be selectable on s1 when it is editable, hence && in terms of the concept your solution is great. Thanks

View solution in original post

Helpful resources

Announcements
PA 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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (58,329)