Data Valid between two dates, but only in certain views

I have a form that I only want them to be able to input a date in the next 30 days.

Valid If: and([DATE]<today()+31, [date]>today()-1)

However, in a different view, I donโ€™t want this restriction - the manager needs to be able to update incorrect data from previous dates - as far back as the beginning of data collection.

Point me in the right direction on a way to do this?

*EDIT: I have a different view for this. View I want the restriction is a form (scheduling_form) and the view I donโ€™t want the restriction is a table view (verifications)

0 1 133
1 REPLY 1

Aurelien
Google Developer Expert
Google Developer Expert

HI @Seth_Kling

You may want to combine:

That would be something like:

SWITCH(
  USERROLE()="Admin",
  AND([date]<TODAY()+31, [date]>TODAY()-1),
  true
)

Or:

SWITCH(
  CONTEXT("View")="scheduling_form",    AND([date]<TODAY()+31, [date]>TODAY()-1),
  CONTEXT("View")="another_form",    AND([date]<TODAY()+60, [date]>TODAY()-6),
  AND([date]<TODAY()+100, [date]>TODAY()-100)
)

Or:

SWITCH(
  CONTEXT("ViewType")<>"Detail",    AND([date]<TODAY()+31, [date]>TODAY()-1),
  true
)
Top Labels in this Space