if selected field starts with '' then other field = '', elif...?

307
1
Jump to solution
06-25-2020 09:16 PM
RichardWebb3
New Contributor II

Possible to do a compound if statement with starts with being the second argument? e.g.

If selected veg_field starts with 'A' then surface_field = 25, elif selected veg_field starts with 'B' then surface_field = 10

0 Kudos
1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi Richard

You could achieve this using the starts-with() function. The following example returns a number if veg_field starts with 'A' or 'B'; else it leaves the field blank:

if(starts-with(${veg_field},'A'),25,if(starts-with(${veg_field},'B'),10,''))


For more on XLSForm functions and operators, please see: Formulas—Survey123 for ArcGIS | Documentation 

Best,

Jim

View solution in original post

0 Kudos
1 Reply
Jim-Moore
Esri Regular Contributor

Hi Richard

You could achieve this using the starts-with() function. The following example returns a number if veg_field starts with 'A' or 'B'; else it leaves the field blank:

if(starts-with(${veg_field},'A'),25,if(starts-with(${veg_field},'B'),10,''))


For more on XLSForm functions and operators, please see: Formulas—Survey123 for ArcGIS | Documentation 

Best,

Jim

0 Kudos