Forum Discussion

LB's avatar
LB
Qrew Cadet
2 months ago

Clearing a formula date field

I'm trying to find a solution to clearing 2 formula date fields based on a selection in another drop down field. 

I've tried to set up a form rule for this but it appears the formula date fields aren't showing as an option in the "then" section...what I'm needing is when the user selects case rounds type as MD requested to then clear and hide the 2 formula date fields as they are no longer needed. It will let me hide the field in the form rule, but won't give me an option to clear those fields. 

Not sure if there is a better/different way I should be setting this up?

  • You could not change the value of a formula field using a form rule because the formula just always calculates according to the formula. You could change the formula to take into account the form rule conditions, and make it calculate to zero or to blank if some conditions are not met. 

    • LB's avatar
      LB
      Qrew Cadet

      ok, currently in the date field formula I have it adding a date that is 90 or 180 days in the future based off the date entered in another field. 

      [Date of Rounds/Consult]+Days(90)

      Do I just add an if statement to this formula to identify the additional criteria to process this field?

      • Yes, an IF statement,

        IF(

        [Followup Type] = "Standard",

        [Date of Rounds/Consult]+Days(90),

        [Followup Type] = "Extended",

        [Date of Rounds/Consult]+Days(180)])

        ~~~~~~~~~~~~~

        Or you can also do this.

        var number NumDays =Case([ Followup Type],

        "Standard", 90,

        "Extended", 180);

        [Date of Rounds/Consult]+Days($NumDays)

  • LB's avatar
    LB
    Qrew Cadet

    Thank you! I'm not sure how to structure the formula to not add a date if the case rounds type is = to MD Request

    I do want the dates in the fields to populate in the fields for 90 days date and 180 days date when a date is added to the date of consult field - but I don't want it to add a date to those fields if the case rounds type is selected as MD Request regardless if there is a date entered in the date of consult field. 

    • Do you have a partial formula working which you can post.

      Or say in full words the complete logic that you are trying to achieve. 

      or else 

  • LB's avatar
    LB
    Qrew Cadet

    Or...maybe I can look at it from this angle too...I only need the 90 day and 180 day date fields to populate/calculate from the Date of Rounds field if the case rounds type is = to initial rounds

    • Try this var number NumDays =Case([ Followup Type],

      "Standard", 90,

      "Extended", 180);

      var Result = [Date of Rounds/Consult]+Days($NumDays);

      IF([case rounds type] <>  "initial rounds", $Result)

       

       

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        ... or were you saying to just add zero days of the case rounds type was initial rounds.