Select to view content in your preferred language

validate a field in web app builder

910
1
Jump to solution
09-17-2018 09:04 AM
MRReddy
Occasional Contributor

i'm using smart editor widget in web app builder and when user entering a field called SIC_ID and we don't want to allow him to enter wrong number, which was not in database

we published SIC  table along with other tables in feature service.  how to validate when user entered SIC_ID,,,,,,how to verify do we have that ID in SIC table,............ if it's true then no error, otherwise throw an alert or ! symbol ...indicating SIC_ID is invalid.

can this be done in web app builder?

Thanks

Andres Castillo

0 Kudos
1 Solution

Accepted Solutions
AndresCastillo
MVP Regular Contributor

method 1:

Try adding a domain to the 'SIC_ID' field at the geodatabase level, and assign coded values to the domain for each ID that exists in your table.

If you have a lot of ID's, this task might get done faster by using the batch mode of the 'add coded value to domain' tool.

In WAB, this should force the user to pick the ID from the drop-down of coded values.

Let me know if this works to see if we use a different strategy.

method 2:

Is the table that contains the 'SIC_ID' field a feature class, or non-spatial table?

If you can make it a feature class, you can use the attribute actions (command of the smart editor widget) on the fc the user is inputting an ID field to copy over the 'SIC_ID' field into the user's ID field, based on an intersect between the two feature classes within approximately 10ft.

For this to work, you will add the specific index of the map service (for example, http://...../mapserver/2, rather than http://.../mapserver)  to the web map, so that the widget can read the layer.

method 3:

See the Reviewer dashboard widget.

https://doc.arcgis.com/en/web-appbuilder/create-apps/widget-reviewer-dashboard.htm

I personally have not used this, but might be helpful.

View solution in original post

1 Reply
AndresCastillo
MVP Regular Contributor

method 1:

Try adding a domain to the 'SIC_ID' field at the geodatabase level, and assign coded values to the domain for each ID that exists in your table.

If you have a lot of ID's, this task might get done faster by using the batch mode of the 'add coded value to domain' tool.

In WAB, this should force the user to pick the ID from the drop-down of coded values.

Let me know if this works to see if we use a different strategy.

method 2:

Is the table that contains the 'SIC_ID' field a feature class, or non-spatial table?

If you can make it a feature class, you can use the attribute actions (command of the smart editor widget) on the fc the user is inputting an ID field to copy over the 'SIC_ID' field into the user's ID field, based on an intersect between the two feature classes within approximately 10ft.

For this to work, you will add the specific index of the map service (for example, http://...../mapserver/2, rather than http://.../mapserver)  to the web map, so that the widget can read the layer.

method 3:

See the Reviewer dashboard widget.

https://doc.arcgis.com/en/web-appbuilder/create-apps/widget-reviewer-dashboard.htm

I personally have not used this, but might be helpful.