Relevant field based on multiple conditions being met

417
1
03-12-2019 07:36 AM
DarrellKundargi
New Contributor

I'm trying to create a relevant condition based on whether or field staff need to record one or two pieces of data.

The two types of data are 1) pump meter readings, and 2) staff plate readings.

Some gages are just pump meter readings, some gages are staff plate readings, and some gages are both. 

For the gages that are both, on some days the staff need to record just the pump meter readings, other days they just need staff plate readings, and some days they need both. Whatever the type of data they need to record, I want that data field to be required.

I created a relevant formula that works, here's an example:

${pondStaffRead}='yes' or ${Gage_Name}!='#1_20HP' or ${Gage_Name}!='#2_50HP' or ${Gage_Name}!='#3_75HP' or ${Gage_Name}!='#4_60HP' or ${Gage_Name}!='#5_30HP' or ${Gage_Name}!='Gator'

Every time a new gage comes online I have to update the relevant field for both data types. Is there another I can accomplish this that isn't so unwieldy?

Thanks,

DK

0 Kudos
1 Reply
by Anonymous User
Not applicable

Hi Darrell,

How about using the contains() function in the relevant statement if all the gage names have a common string in them. I tested with your survey and the following should work:

${pondValveRead}='yes' or contains(${Gage_Name}, '#') or ${Gage_Name}='Gator'

This will work based on every gage name have a # in it, and then if you add new ones with a #, they will be included. If you use a different common string for other gage types you could add that as a different contains() statement also.

You could also try using starts-with() or ends-with() if you just want to query a certain part of the string at the start or end. See full list of supported operators and functions here: Formulas—Survey123 for ArcGIS | ArcGIS 

Phil.

0 Kudos