Hosted feature layer views and domains

1995
5
07-06-2017 02:55 PM
RandyBurton
MVP Alum

I have been exploring how to Create hosted feature layer views.  My goal is to use the view to hide certain fields while limiting editing (as discussed in other threads, such as: Restrict editing to authorized users while leaving the map viewable to the public).

 

When using Set View Definition >> Define Fields for my feature layer, the fields using domains are checked and grayed out. Thus the “visibility can’t be changed”; these fields cannot be hidden. Does anyone know the reason for this limitation?

However,  it appears the json file for the layer can be edited to hide those fields using domains by setting “visible” : false.  Is this a suitable workaround?

0 Kudos
5 Replies
RandyBurton
MVP Alum

Rather than being related to domains, the issue may be related to the field's nullability.  If the field cannot be set to null, it is grayed out and visibility cannot be changed using Set View Definition >> Define Fields.

The question remains, is there an issue to editing the view's json file to hide the field?  The only issues I can think of would be if the layer data is editable through the view's permissions.  Any thoughts or suggestions are appreciated.

0 Kudos
RandyBurton
MVP Alum

Any suggestions on this topic?

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hey Randy,

Can you share the steps to reproduce this issue?

I just confirmed that these are the steps work to remove a field with domains from a hosted feature layer view.?

1. Create a hosted feature layer

2. Create a field with domains

3. Add data to the feature layer

4. Create a hosted feature layer view

5. Set a view definition that doesn't contain the field with domains

-Kelly

0 Kudos
RandyBurton
MVP Alum

When creating a feature service on AGOL, the fields (with or without domains) allow nulls.  You can add a feature and delete the default value (ignoring the error message) and save the feature with a null value in the field.

In my usual workflow, I create my feature class with desktop. For a field that uses a domain, I will set it to not allow nulls.  As I recall, when I allowed domain fields to use nulls, that was a selectable option to the field crews.  If a field does not allow nulls, it cannot be hidden in the view definition

I wanted to create a non-editable view and hide some of the domain fields from public view. The pop-up can be configured to hide the field, but it is possible to navigate to the public view and see the values in the domains that are only hidden via the pop-up.

0 Kudos
KellyGerrow
Esri Frequent Contributor

Thanks Randy,

I see how you were able to reproduce this issue now. Can you get this bug reported to support so we can work to address this workflow in the future? Let me know if you need help getting in contact with technical support.

-Kelly

0 Kudos