Hi, I have received an error (Arcade error : FeatureSetByPortalItem cannot be used in this profile) when my attribute rule was triggered. What I am trying to do is, updating attributes of $feature based on attributes of the intersected features of Portal Item. The portal item is not my organization's one but I have access to it.
As this is an portal item, I used FeatureSetByPortalItem to get a feature set for my attribute rules. The rule that I made is only for Update mode. The rule has been verified and saved successfully in ArcGISPro GUI. However, I have received the error when the rule was triggered by editing a feature.
Much appreciated if anyone knows of any solution to it.
Thanks in advance.
According to ArcGIS Arcade - From a portal item, "As long as the profile allows you to access data, you can also establish a connection to a FeatureSet from a data source outside the profile's context, such as a layer from ArcGIS Online, or a layer from another portal. This is done with the FeatureSetByPortalItem() function."
I have an account to access to the item, I have tested FeatureSetByPortalItem for pop-up to see if the connection can be established - it works, and my attribute rule was verified and saved without any error.
I have no idea what that error is...
My only guess is that running in Pro, it is accessing your login to the portal. When run by the database, it does not have a valid token to access the service.
If you look at the documentation for FeatureSetByPortalItem, it doesn't include Attribute Rules as one of the profiles it works in.
Hi @KenBuja, thanks for your reply.
I just thought the "profile" means the profile of my account that has valid access to the item in the portal. I don't understand the meaning of the profile in this context, could you please tell me what the profile is?
As you said, Attribute Rule is not included in FeatureSetByPoralItem, I gave it a try FeatureSetByName instead; however, it did not work either. Do you know any limitation in this case?
Profiles are the rules in how different Arcade functions can be used. For example, the Labeling profile doesn't allow you to use the FeatureSet functions due to performance issues (see this post). The FeatureSetByName function works with items in a specific map or feature service, not any item on a Portal.
I've run into this as well. I have an enterprise system with about 700 feature classes that we have in an enterprise db that also has portal items published. I can't use any of them with my AR due to FeatureSetByPortalItem not being able to be used by AR in the SDE. I also can't just put all of this data in the editing db to be able to use FeatureSetByName and $datastore as well. THIS DEFEATS THE PURPOSE OF AN ENTERPRISE GEODATABASE SETUP! Also we are using our own internal enterprise/portal/server set up as we can't put this data on ArcGIS Online either.
ESRI - when will you be making the FeatureSetByPortal items available in ArcPro AR? Some of us can really use this functionality.
Thanks,
Lorinda