Hello!
I have a stand-alone table in ArcGIS Online that I would like to link to a feature service. The table and feature service are not related but both contain a common field. Is it possible to use Arcade to pull back records from the table into the feature service popup where the records match? Any help is appreciated.
Thanks.
Yes, you can do this by using the Filter function. This code returne all the records in the table that have same attribute in the common field
var asset = $feature.theCommonField; var fs = FeatureSetByPortalItem( Portal('yourPortal'), 'itemId', 0, ['*'], false ); var related = Filter(fs, "theCommonField = @asset");
Hey @KenBuja, Thanks for this! Can you expand on it a bit and assist in setting my expression up? I'm assuming I'm inputting something wrong or missing something as I'm getting an error. Here's my setup below. The ID within the portal is the ID for the stand-alone table.
var asset = $feature.PWID; var fs = FeatureSetByPortalItem( Portal('https://njdep.maps.arcgis.com/'), 'e6854954c9a744e09a0cfbe777d20492', 0, ['*'], false ); var related = Filter(fs, "PWID = @asset");
What is the error that you're getting? Also, have you checked whether the layerId is correct?
The ID is correct. The error I get is "Test execution error: Unknown Error. Verify test data."
If you put in "return fs" between line 8 and 9 and hit the Run button in the upper left corner, do you get back a valid dataset?
I get the same error.
Either the itemId ('e6854954c9a744e09a0cfbe777d20492') or the layerId (0) is incorrect.
DaveK did you ever figure this out? I'm getting the same error on several different features and tables. It works on a select few so I know I'm doing something wrong almost consistently. Thanks!
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.