Is there a way to use arcade expressions to turn off certain fields in arcgis online?

240
6
11-19-2019 10:25 AM
RobertPhillips
Occasional Contributor III

Hi,

I have been wondering if there was a way to use arcade expressions to turn certain fields on and off depending on the current month. I am trying to set up something as kind of a test and I wasn't sure if there was a way to accomplish this. Any ideas, thoughts, or examples would be greatly appreciated.

Robert

0 Kudos
6 Replies
XanderBakker
Esri Esteemed Contributor

Hi RP.CObb ,

It is feasible, but will require multiple expressions referenced in a custom html pop-up. Can you explain a little more about this requirement and provide an example of what you would like to obtain?

0 Kudos
RobertPhillips
Occasional Contributor III

Thanks Xander.

I was looking to use this method for one of the projects that I am working on. The reason being is because multiple people will be allowed to make edits only to specified fields based on the current month. The fields that I have are every month in the year and I was looking to see if I could dynamically enable specific fields to be edited for the current month. That way it not only simplifies what they need to edit, but also reduces the risk that any other information might get improperly edited.

I hope this makes a little sense.

Robert

XanderBakker
Esri Esteemed Contributor

Hi Robert Phillips ,

I am starting to understand where you are heading, but the visibility of fields in editing mode is not something that is controlled or influenced by Arcade. What I can imaging being a potential solution, would be the creation of hosted feature layer views for each month (hiding the fields that are not to be edited for each month) and share (and un-share!) these to the editors. Sounds like a lot of work on the management part of the layers. The alternative, as afar as I can see at this moment) would be develop a editing widget that only provides the fields that should be edited for the current month. 

0 Kudos
RobertPhillips
Occasional Contributor III

Thanks Xander,

I was hoping to find some automated solution for what I'm trying to do. I

was thinking of either doing python or some other form to enable and

disable editing for certain fields. I'll try your suggestion while looking

for other options.

0 Kudos
CliveSwan
Occasional Contributor II

Hi Robert,

If the fields are not required, it would be easier to toggle them off in ArcMAp.

The fields will not be visible to the users and it simplifies the coding in Arcade.

Regards,

Clive

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Clive Swan ,

I think the OP is looking for a dynamic solution, where the fields that  should display are defined by the current month. I have some examples to do this with Arcade, based on a more dynamic case where the symbology is based on the current moment showing the streets that will be cleaned that day and in the pop-up the next moment garbage will be collected. Unfortunately, they are in Spanish: