Select to view content in your preferred language

Survey123 if calculations using wildcards

1399
2
06-20-2017 11:08 PM
BiosisGIS
New Contributor III

Hi,

Is it possible to use wildcards in if calculations? I want to return a true value if part of a string matches a piece of text, e.g. if(${speciesname} = 'Eucalyptus*', 1, 0). Is this possible?

Cheers,

James.

2 Replies
JamesTedrick
Esri Esteemed Contributor

Hi,

Please take a look at the regex function, which is described in detail at Formulas—Survey123 for ArcGIS | ArcGIS (bottom of 'Constraints' section) - you should get what you want with regex(${speciesname}, 'Eucalyptus')

BiosisGIS
New Contributor III

Thanks James. That did the trick. I did look into using regex initially but couldn't figure out how to use it for my purposes from the documentation. The two examples provided are very complex and so I found it difficult to decipher how it worked. Perhaps a couple of simpler examples in the documentation would assist newbies to its use like me?

Cheers,

James.