IF statement in relevant column

628
5
07-30-2020 03:27 PM
CesarAvila
New Contributor II

Hi guys. 

I'm S123 connect trying to figure it out something that I believe that should be fix with an if statement. I did a workaround but my survey takes some time to upload, maybe there is a better solution and I haven't found it.

Basically I have a survey question with multiple choices that contain activities description. The user only need to select one. 

Based on the selection will show a geolocation or geotrace.

   

I get it to work by adding a lot of geopoint and geotrace functions in the spreadsheet but it takes sometime to upload because of the amount of data in it.

Maybe there is a better solution by doing an if statement in the relevant? Don't know if there is something like that around.

Please let me know.

Thanks.

0 Kudos
5 Replies
Jing_Sun
Esri Contributor

Hi,

My understanding of your workflow is that, if user answer the question {activitysub} (no matter what they select), then display a geopoint and a geotrace question. 

If that's the case, I would suggest using a relevant statement to monitor whether the question {activitysub} has been answered. 

Something like this:

string-length(${activitysub})>0

See here: https://community.esri.com/thread/187267-can-relevant-field-be-dependent-on-if-condition-is-not-null 

Then you only need one geopoint and one geotrace question for this.

*Sorry my previous answer (before editing) was based on a misunderstanding of your workflow.

Cheers,

Sun

0 Kudos
CesarAvila
New Contributor II

Hi Jing.

The workflow is that the geotrace or geopoint will be based on the select_one for the {activitysub} (there are 51 answers). It matters what they select because that will trigger the geotrace or geopoint.

As an example below: If the user select 411, will trigger a geolocation. If the user select 494 will trigger a geotrace.

I was able to get it to work but takes sometime to upload because I have 52 geopoint/geotrace rows in my spreadsheet.

It would be great that you can put several relevant answers instead of only one. Something like this: selected(${activitysub},'425' or '425' or '432' or '433' or '436' or '499' or '530' or '612' or '787)

0 Kudos
Jing_Sun
Esri Contributor

Hi,

I think you can use 'or' to group a number of selected() functions.

Something like this:

selected(${activitysub},'411') or selected(${activitysub},'425')

Cheers,

Sun

0 Kudos
CesarAvila
New Contributor II

Great. That worked. 

Now is giving me this issue of not beign able to publish.

The workflow depends if they select one activity related to a line will be a geotrace. If is a point will be a geopoint. Do you guys have like a workaround for that?

Thanks

0 Kudos
DougBrowning
MVP Notable Contributor

It is impossible for a Feature class to be both a line and a point.  Which makes sense.  Remember all 123 does is load data into a feature class on AGOL.

You could try making them repeats so that you have 2 feature classes.  But not going to look the way you want but it would work.

Not sure your workflow but you could have 2 links in collector that opened the correct form.  Not sure how the lookup would go though with some really long if statements.  If you can preload the assets in Collector that may help.

Hope that helps

0 Kudos