Sting-Length...>0 formula not working

1163
8
Jump to solution
06-07-2017 11:27 AM
CarlHolt1
Occasional Contributor III

Since the v2.x update the string-length(${SPEC_COND_1})>0 formula has not been working. When viewed on the form it appears a space is being added. If a user clicks inside the text field and backspaces, the dependent question is hidden.

Example:

string-length(${SPEC_COND_1})>0 formula in the relevant field:

0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Thanks Carl,

It looks like there's a space in the original data table you're generating the URL from.  A workaround would be to add an "and ${question} != ' '" to the relevant questions.

View solution in original post

8 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Carl,

I'm not able to replicate this behavior in Windows or other devices.  Perhaps you could check to see if a space got into the default column of the XLS file?

0 Kudos
CarlHolt1
Occasional Contributor III

No, there is no space in the default column. The behavior appears to be happening when the form is opened from the custom URL link.

This form is being opened from a custom URL from Collector, there is a layer in Collector that has information in these fields, if there is data then the relevant-dependent fields are visible and the users must answer the questions.

Custom URL:

arcgis-survey123://?itemid=102b96d8619f4f58a6a71ec6974a596a&field:GRNWY_NAME={PROPERTY_N}&field:WATERSHED={CREEK_NAME}&field:GW_ID={GREENWAY_I}&field:GRNWY_TYPE={Fee_CE_Acq}&field:NOTES={NOTES}&field:SPEC_COND_1={SPEC_CON1}&field:SPEC_COND_2={SPEC_CON2}&field:SPEC_COND_3={SPEC_CON3}

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Carl, thanks for the added detail.

I'm still not able to reproduce this.  Can I ask you to open the Collector map up in the ArcGIS Online Map Viewer, click on one of the features that generates the issue, and copy the link in the popup and then paste that in a text editor?  This should look much like the link above, with values filled in.  In particular, you should see if the value that is giving a space does so in the link (either a space or a %20 in the URL).

0 Kudos
CarlHolt1
Occasional Contributor III

Yes a %20 does show up.

arcgis-survey123://?itemid=102b96d8619f4f58a6a71ec6974a596a&field:GRNWY_NAME=HAMPTON&field:WATERSHED=Utoy%20North%20Fork&field:GW_ID=UNF11&field:GRNWY_TYPE=Fee&field:NOTES=%20&field:SPEC_COND_1=%20&field:SPEC_COND_2=%20&field:SPEC_COND_3=%20

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Thanks Carl,

It looks like there's a space in the original data table you're generating the URL from.  A workaround would be to add an "and ${question} != ' '" to the relevant questions.

CarlHolt1
Occasional Contributor III

Would the changes to the relevant field overwrite the existing data on the form?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

No, a change of relevant formula does not cause the existing data to be overwritten

CarlHolt1
Occasional Contributor III

I removed the spaces from the fields using the feature service layer in AGOL.

0 Kudos