I have a feature layer that I am not using in a WebMap (I am using it in a Details element in a dashboard). I want to use the python API to set some of the fields to hidden AND, if possible, set the order of the way the fields display in the popup (that is how they appear in the Details). I have looked around and found information on how to do it with a webmap, but not a feature layer.
I can see the visibility info like this:
item = gis.content.get(item_id)
item.get_data()['layers'][0]['popupInfo']['fieldInfos']
I tried the following, and it does not result in an error, but it is not changing the visibility.
item.layers[0].manager.update_definition({'fieldInfos': {'fieldName': 'Longitude', 'visible': False}})
What is the proper syntax for this update? Is it possible to set the order programmatically?
Thanks in advance for any assistance!