Forum Discussion

sfountain's avatar
sfountain
Qrew Cadet
26 days ago

Grabbing value between 2 fields

Hi,

I'm trying to create a text formula field that would compare 2 text lookup fields for an employee name. So if there isn't a value in field A, it will pull a value from field B or vice versa. For reference, these 2 fields have a relationship between tables, and in some instance the name is populated in one table and not the other. 

Field A:

 

Field B:

 

If anyone has suggestions, please advise as I've tried several different formula functions and can't get this to work as I expect.

Thanks,

-Scott

  • Thanks for the quick response, Mark! That seems to work!! I was over complicating it to say the least.

  • Thanks for the quick response, Mark! That seems to work!! I was over complicating it to say the least.

  • Mark,

    Had yet another question if you don't mind? We have a process where our employees need to be fit tested for a respirator mask to ensure a snug fit. This testing is required annually to ensure their mask type still fits as expected due to some factors like weight gain/loss, facial hair as examples. I have created 2 fields that would show on a report how many numbers of passed fit tests they've had, then another to show the most recent record ID should they have many since it is an annual process of being re-tested. 

    1st field - checks for the number of passed fit tests an individual has

     

    2nd field - checks for the max/most recent fit test record

     

    Now the question is, I have a pipeline that would send email notification to employees letting them know their mask fit testing is going to expire in 60 days, 30 days, 14 days, 7 days, then when it's expired. It does seem to work fine with the current step settings of the Pipeline, however there were a few instances where it evaluated all past fit test records, and not necessarily the most recent one, which is what I want. Any suggestions on how to leverage one of the fields in the Pipeline as additional filtering criteria when searching for records? Or any other thoughts? I'm not a Pipeline expert by any means!

    Hope I explained that well enough to follow along.

    Thanks again!

    -Scott

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

      There is more than one way to do this, but one way is to lookup that Max Record ID field down back into fit tests.  
      then make a formula checkbox called [Most Recent Fit test?] to flag where the the Record ID =[Max Record ID]

      Then use that checkbox field to filter the Pipeline search. 


  • Thanks for the suggestion, appreciate it! Sounds like it would work, and was actually going to go somewhat in that direction but didn't see it through, so I'm going to give it a try. 

  • Ok, so Record ID =[Sensitivity Check - Max Record ID] does work in most cases. However, there are some instances where they would go through another table to acquire that information (either Sensitivity Check table or Med Eval Questionnaire Intake table). So when I try to compare the 2 to pull the most recent record, I'm getting an operator error with this formula - 

    If([Sensitivity Check - Max Record ID] <> "",[Sensitivity Check - Max Record ID], [Med Eval Questionnaire Intake - Maximum Record ID#])

     

    Where am I going wrong?

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

      To check a numeric field type for blank, you can't compare to empty quotes.  That only works for a text field type.

       

      Set the field properties fir that max Recird us field on the relationship to not treat blank as zero.

       

      then change yiyr furnuks to this

       

      If(not IsNull([Sensitivity Check - Max Record ID]), [Sensitivity Check - Max Record ID], [Med Eval Questionnaire Intake - Maximum Record ID#])

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

        To check a numeric field type for blank, you can't compare to empty quotes.  That only works for a text field type.

         

        Set the field properties for that Max Record ID field on the relationship to not treat blank as zero.

         

        then change your formula to this

         

        If(not IsNull([Sensitivity Check - Max Record ID]), [Sensitivity Check - Max Record ID], [Med Eval Questionnaire Intake - Maximum Record ID#])

  • Thanks, I updated the max record id field properties, and am getting this error now - 

     

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

      I'm now confused as to what you want the formula to do.  That formula will calculate to the numeric value of the highest child of either table.

       

       

      Maybe you want this as a formula checkbox field type.

      Var number MaxRecordID = 

      If(not IsNull([Sensitivity Check - Max Record ID]), [Sensitivity Check - Max Record ID], [Med Eval Questionnaire Intake - Maximum Record ID#]);

      [Record ID#] = $MaxRecordID