Use the smart editor for a json list

513
3
Jump to solution
06-24-2022 01:13 AM
TimothéeBarral
New Contributor

Hello,

I’m using a table which registers data as json. These data are simply lists, like:

[option1, option2, option4]

 I could also save them as:

{option1: True, option2: True, option3: False, option4: True}

The two versions are as good to me, so I can use whichever is the easiest to use in my case.

But, I absolutely need this to be displayed as checkboxes on my edit form, so the users can easily check or uncheck the options they want. So the form needs to aggregate the choices in a json object.

As far as I know, there is no way to do this with the Smart Editor as it is. I would have liked doing it with only a script in the widget, but I don’t think it’s possible.

So, I had a look on editing the widget, to have a custom Smart Editor, maybe with an hardcoded part of the form. But it’s 13k lines of code, so I’m completely lost. Also, it needs to be quite easily modified as the list can be changed. Do you have any idea, any resource to help me, please? Or if you think of another way to allow the user to easily do this? Or is there no other way than altering my table to store my data as booleans?

Thank you

0 Kudos
2 Solutions

Accepted Solutions
AlixVezina
Esri Regular Contributor

Hi @TimothéeBarral ,

Smart Editor does not support it out of the box, and it would be very hands-on to make any update to the attribute inspector to support it. 

Otherwise, have you considered using Survey123 instead? The form will allow you to setup a question with options and checkboxes as you have described. 

When you build your survey, you can add multiple choice questions add choices, and customize these choices. Once it's complete and you publish the survey, the feature layer will be generated from it with a schema already generated for you.

AlixVezina_0-1656082863356.png

If you need to add choices later, you can edit the survey again and republish it.

There are also many other question options to support different data types and Boolean. You can also add some conditions based on previous answers.

AlixVezina_1-1656083063155.png

 

View solution in original post

AlixVezina
Esri Regular Contributor

You should also be able to serve that survey123 through an Experience Builder app to allow editing existing features and interacting with a map and other widgets: Survey widget—ArcGIS Experience Builder | Documentation

View solution in original post

3 Replies
AlixVezina
Esri Regular Contributor

Hi @TimothéeBarral ,

Smart Editor does not support it out of the box, and it would be very hands-on to make any update to the attribute inspector to support it. 

Otherwise, have you considered using Survey123 instead? The form will allow you to setup a question with options and checkboxes as you have described. 

When you build your survey, you can add multiple choice questions add choices, and customize these choices. Once it's complete and you publish the survey, the feature layer will be generated from it with a schema already generated for you.

AlixVezina_0-1656082863356.png

If you need to add choices later, you can edit the survey again and republish it.

There are also many other question options to support different data types and Boolean. You can also add some conditions based on previous answers.

AlixVezina_1-1656083063155.png

 

TimothéeBarral
New Contributor

Hi,

Thank you very much for your answer. Indeed, we thought about Survey123, but we need our app to allow the editing of existing points. As far as I know, this isn’t doable with Survey123, is it?

Edit: indeed https://doc.arcgis.com/en/survey123/browser/get-answers/editexistingdata.htm

AlixVezina
Esri Regular Contributor

You should also be able to serve that survey123 through an Experience Builder app to allow editing existing features and interacting with a map and other widgets: Survey widget—ArcGIS Experience Builder | Documentation