Select to view content in your preferred language

Survey123 Connect - readonly expression

3184
7
11-30-2021 02:36 AM
MartaPodsiad_123
Emerging Contributor

Hi,

I am using Survey123 Connect Version 3.13.249. 

I am trying to put an expression in the xlsform readonly field, so the fields are only editable when certain expression is met (image 1). The expression should apply to records already collected in Survey 123 not to the new entries. In general, when the polygon is selected in the dashboard some fields should not be editable when the record has specific request status.

 

Although, I can publish the survey without an error, once it's opened in the dashboard as embedded content the field is still editable (image 2).

0 Kudos
7 Replies
jcarlson
MVP Esteemed Contributor

You could hard-code the expression into your URL, perhaps. If you have a hidden null field in your XLS form, say, readonly_bool, you can have your URL go to:

https://survey123.arcgis.com/share/your-survey-itemid?mode=edit&globalId={globalid}&field:readonly_bool=true
- Josh Carlson
Kendall County GIS
0 Kudos
MartaPodsiad_123
Emerging Contributor

 Hi, thank you for the suggestion but it did not solve the problem.

0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi @MartaPodsiad_123  You may want to try pulldata("@property","mode") it will return 'edit' when the survey is opened in edit mode. You can use this value in your readonly expression.

0 Kudos
MartaPodsiad_123
Emerging Contributor

Hi, Thank you for the suggestion. I will give it a go

 

0 Kudos
MartaPodsiad_123
Emerging Contributor

Hi,

Unfortunately, it does not work.  I want the model name to be readonly if the the status is 'ekfb_rejected'.

This is my xls 

MartaPodsiad_123_1-1643531933915.png

After publishing the form I can still edit the model field in the embedded xls form in the dashboard

MartaPodsiad_123_3-1643532070250.png

The xlsform is embedded in the dashboard with the url ending with

/portal&mode=edit&autoRefresh=true&globalId={globalid}

The xlsfrom reads only the entries that have been already collected. It is not designed to submit new records.

0 Kudos
Daniel_Perkins
Occasional Contributor

Hi @MartaPodsiad_123 ... did you have any luck figuring this out? I'm having a similar issue. Thanks!

0 Kudos
mikaël
Frequent Contributor

Same question here. Conditional readonly field (with formula) does not work in web app. Works in Connect.

Tried with formula version and also if(formula, 'yes', ''). None work.

0 Kudos