Smart Editor populate field with default value

2913
14
05-11-2021 08:23 AM
JoseSanchez
Occasional Contributor III

Hello everyone,

I am using Smaprt Editors with WAB in Portal. 

I am looking for a way to populate a field with the value "No", before the editors starts editing.

Also I would like to disable edits in this same field and predefide its value to "No".

How can I do that?

Thanks

 

 

 

 

0 Kudos
14 Replies
AlixVezina
Esri Regular Contributor

Vincent,

I assume you may've added the new field and its default value through ArcGIS Pro? I think what's happening is that the feature template attribute is missing in your service's JSON and so the values are not coming through, and same issue with the presets. This is a known bug right now.


A workaround for this is to update the feature's edit templates in the web map - which should add the template back into the JSON and resolve the issues.

For example here is a sample layer where my new field added through Pro is missing in the template attributes (see on the right):

AlixVezina_1-1640038162096.png  AlixVezina_0-1640038132417.png

 

In your web map you will need to manage the feature templates for that layer.

AlixVezina_2-1640038306117.png

And then just click "SAVE CHANGES" at the bottom (even if you haven't made any changes in the map). The template will be written into the JSON and the value will come through in Smart Editor.

AlixVezina_3-1640038398096.png

AlixVezina_7-1640038677002.png

 

VincentRobinson
New Contributor III

Thank you very much!

0 Kudos
AlixVezina
Esri Regular Contributor

Hi @JoseSanchez,

Thank you for your question.


I am looking for a way to populate a field with the value "No", before the editors starts editing.


In the Attribute Actions section of the Smart Editor widget configuration, you will be able to set Presets to achieve this: Preset Attribute Actions


Also I would like to disable edits in this same field and predefine its value to "No".


In the Smart Actions section of the Smart Editor widget configuration, you will be able to set a new expression to achieve this: Smart Actions

There are some example for this functionality in this video: Get Smart About Editing - Configure a Data Collection Form 

 

ahargreaves_FW
Occasional Contributor III

@AlixVezina I am having the same issue using WAB for Portal 10.9.1.  I set an 'Attribute Action Preset' so the status field of a Feature Service should be 'Reported' (which is a domain value). However this fails to populate the field when the Smart Editor dialog opens.

ahargreaves_FW_0-1673550681646.pngahargreaves_FW_1-1673550826764.png

ahargreaves_FW_2-1673550968784.png

 

AlixVezina
Esri Regular Contributor

@ahargreaves_FW  I believe this may be the same issue we recently fixed in a later version of the Smart Editor widget. First, please try the steps I've provided here, these should also help with resolving this issue.

 

0 Kudos