Select to view content in your preferred language

arcade calculate expression - Unknown Error

738
4
09-08-2023 06:32 AM
SarahRijneke
Occasional Contributor

I created a field maps app several months ago that includes an arcade expression to calculate the DueDate field for features that are added to the app. I used the FeatureSetByName($map...) function to access attributes in a static road feature service (i.e. a copy of our roads feature layer). Recently, someone in my organization added a new roads feature service that reflects our 'live' data i.e. it updates as features are edited in our SDE geodatabase. This layer was added to portal and the portal item was added to ArcGIS Online with stored credentials. When I try to reference the new layer in my expression I receive the following error: Test execution error: Unknown Error. Verify test data. I have also tried to use the FeaturesetByPortalItem function and receive this error: Test exection error: Invalid variable assignment..  Verify test data. Does anyone know why I cannot use the same expression to access attributes in the 'live' roads feature service?

0 Kudos
4 Replies
DavidPike
MVP Frequent Contributor

Is it a feature service or map service (I'm guessing you're trying this on a map service)?  have you tried FeatureSetByPortalItem()?  What does the url look like for this 'live' item.

0 Kudos
SarahRijneke
Occasional Contributor

the info I am tryin to access is from a Feature layer. I also tried FeatureSetByPortalItem and get the following error: Test execution error: Unknown Error. Verify test data

SarahRijneke_0-1694434445784.pngSarahRijneke_1-1694434459425.png

 

0 Kudos
SarahRijneke
Occasional Contributor

The arcade expression works in field maps now using FeatureSetByName($map...)

I have a model in ArcGIS pro that connects to the same datasets. The model calculates the DueDate field in a similar way and I would like it to reference this new feature service as well. When I use the FeatureSetByPortalItem function I see an Invalid expression. Portal item not found error. Is it possible to use a portal items to calculate fields for features that are stored in a geodatabase?

0 Kudos
JustinReynolds
Regular Contributor

It should work based on the documentation.

The field calculate Arcade Profile lists "Portal Access" as one of its function bundles.  The FeatureSetByPortalItem function is a member of the "Portal Access" function bundle. This function has been around since Arcade 1.8 and ArcGIS Pro 2.4.

The error you specify above seems to suggest that you are not pointing to the correct portal or it is having issues authenticating.  I don't really use model builder but you may need to sign-in to the portal of interest in the model... https://community.esri.com/t5/arcgis-pro-questions/setting-a-portal-connection-in-modelbuilder-in/td...

 


.

- Justin Reynolds, PE
0 Kudos