cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (17,643)