Smart Editor : populate field with your string (parameter from URL)

646
9
09-15-2021 11:10 AM
helenchu
Occasional Contributor II

All,

I'm looking for a way to populate a field in smart editor (edit attribute field of existing feature) with a string (which will come from the URL parameter).  I'm not familiar with customizing widget but this is something I have to make it happen to keep my job so any help and guidance is greatly appreciated.

Thanks

0 Kudos
9 Replies
AlixVezina
Esri Regular Contributor

Hi @helenchu ,

Use the Preset Attribute Actions to populate a field using a value from a URL parameter.

An example is provided in this video:

 

 

helenchu
Occasional Contributor II

Thank you so much @AlixVezina .  I'm still having trouble getting my field configured to take the variable from the url.  I'll watch the video again and keep trying.  I'll keep you posted of how it's going.  

AlixVezina
Esri Regular Contributor

@helenchu perhaps this tip from the documentation can help? Smart Editor widget—ArcGIS Web AppBuilder | Documentation

LeLuong
New Contributor III

I tried but still failed to get it work in my case.  My url is below.  (I use Near Me widget to get to the subject polygon) ....../webappbuilder/?id=12&find=123456789 . 

Then I use Smart Widget to modify the attribute values of another polygon closed by.  I need this (non-subject) polygon popup with pre-defined value of (the subjectID in url 123456789) in one of the field.  Image is attached. SmartEdit.PNG

In Smart Edit configuration, I created group and select the field that I want the the SubjectID value in url to  go to.  Must be something I missed or did wrong ?  Thank you so much for your help.  The video you sent me is super helpful but unfortunately I was unable to pull it through.  

SmartEdit1.PNG

0 Kudos
helenchu
Occasional Contributor II

I tried but failed to get it worked in my case.  My url is like below.  (I use Near Me widget to get to the subject polygon)

....../webappbuilder/?id=12&find=123456789 .  Then I use Smart Widget to modify the attribute values of another polygon closed by.  I need this polygon popup with pre-defined value of (the subjectID in url 123456789) 

SmartEdit.PNG

 

 

 

 

In SmartEdit widget, I created groupName "find" to match with the word "find" in url.   I must be doing something wrong ?  Thank you very much Alix for all your help.

SmartEdit1.PNG

 

0 Kudos
AlixVezina
Esri Regular Contributor

Hi @helenchu ,

Preset attribute actions only work when creating new features, not when updating a feature's attributes.
Please see for more details:
https://doc.arcgis.com/en/web-appbuilder/create-apps/widget-smart-editor.htm#:~:text=populate%20with...

Also, for presets in general, the word "find" may be be part of the core web appbuilder URL parameters so it may be worth trying with a different group name.

Depending on your complete workflow and what you are trying to do, there may be other ways to do this. If you are able to provide step by step details on what you need to achieve, we can look for a workaround.

LeLuong
New Contributor III

Hi @AlixVezina ,

Thanks for clarifying the Preset attribute action concept for me.   I use  the Comp Finder web appbuilder template to build an app for my business case.  The logic is

1/ Users click on a hyperlink to open the map and zoom to subject parcel (subjectID and runID included in the url)

https://myserver/Myapp/?find=123456789&run_id=20201210

I already got that part worked.

2/ My layer has subject parcels and many non subject parcels .  Users can select any parcel to add that parcel as a comparable parcel for the subject  (by editing the attribute values).  Right now I have 3 fields for users to edit (reason to include, subjectID to tie with , runID to tie with) .  

Instead of having users to copy /paste the subjectID and runID from url to the textboxes, I'd like to have those values auto populated when Smart Edit widget opened.

Hope that makes sense.

Thank you

0 Kudos
AlixVezina
Esri Regular Contributor

Hi @LeLuong ,

If I understand this correctly, you would like to automatically populate fields from your URL parameters into target fields for the existing feature being edited, rather then only when creating new features. And I believe it's also what @helenchu is trying to do.

I've looked around and I can't seem to find a way to do this either. @Jianxia do you have any ideas if this would be possible in Experience Builder?

The following blog describes a workflow that is, I believe, somewhat similar: Using Experience Builder and Survey123 to pass attributes and geometry from one layer to another (es...

 

0 Kudos
Jianxia
Esri Regular Contributor

I think this is something available in ArcGIS Survey123. See the post.

You may use the Embed widget in Experience Builder to connect with the Survey123 form which passes field names and values in the edit mode as url parameter when a feature on the map or in a table is selected.