cancel
Showing results for
Did you mean:
Highlighted
Level: Powered On

## Use calculated date to show another field in view or edit mode within 2 week window

I have a power app linked to a sharepoint list.  I have a calculated date field in the share point list. What I am trying to do is if today's date is within 2 weeks (1 week prior and 1 week after) of the calculated date I want the field to be in edit mode. If today is not within that 2 week window I want the field to be view only.

this is what I have come up with. The calculated date in this formula is '4 Mth Date'. This is not working.

Any ideas?  I am trying to put this on the card's display mode.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Use calculated date to show another field in view or edit mode within 2 week window

If I understand you on this, you're looking for a datacard to be in edit or view mode based on the record date (in your calculated date) being within a 1 week (7 day) before or after today's date window.

If so, then consider this formula:

If(Abs(DateDiff(DateValue('4 Mth Date'), Now(), Days)) > 7, View, Edit)

This will determine the number of days (DateDiff) between now and the calculated date.  It then takes the Abs value (positive value) of that DateDiff.  If it is greater than 7 (more than a week), then it will be in View mode, otherwise it will be in Edit mode.

I hope this is helpful for you and clear.

_____________________________________________________________________________________
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.
Super User

## Re: Use calculated date to show another field in view or edit mode within 2 week window

If I understand you on this, you're looking for a datacard to be in edit or view mode based on the record date (in your calculated date) being within a 1 week (7 day) before or after today's date window.

If so, then consider this formula:

If(Abs(DateDiff(DateValue('4 Mth Date'), Now(), Days)) > 7, View, Edit)

This will determine the number of days (DateDiff) between now and the calculated date.  It then takes the Abs value (positive value) of that DateDiff.  If it is greater than 7 (more than a week), then it will be in View mode, otherwise it will be in Edit mode.

I hope this is helpful for you and clear.

_____________________________________________________________________________________
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.

Announcements

#### PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

#### Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Watch Sessions On Demand!

Continue your learning in our online communities.

#### Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

#### Power Platform World Tour

Coming to a city near you

#### PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

#### Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

#### Power Platform Summit North America

Register by September 5 to save \$200

Top Kudoed Authors
Users Online
Currently online: 516 members 4,613 guests
Recent signins: