Hi, i have an arcade script who works perfectly on my Map Viewer when i set my pop-up box.
But when I want to integrate the same things on a text widget i have some issue with the "$feature." function :
There is no way to use this type of function ? Or did I miss something ?
Thanks 😉
In the same way, it is impossible to use the "FeatureSetByRelationshipName" function ??
Hi, this is currently a known limitation. When using the $dataSources variable to reference the layer, it does not access the service directly, and therefore cannot retrieve the data relationship information.
Shengdi
The text widget doesn't have access to the $feature variable, just the $dataSources variable (see the profile for more information). You can get the selected feature with the syntax
var dataSource = $dataSources['dataSource_1-187acf797e1-layer-5-selection'];
var selectedFeatures = dataSource.selectedFeatures;
var feature = First(selectedFeatures)
Ok thanks
If I understand correctly, I can't show on a text widget (or a text widget embedded on a list) information about building and information about offers who is associated to a building with a relationship class ?
My app mecanics do not very use the select function. It's more like filtering layers and read information on list, text..
It sad it seems to be very limited in comparaison to what we can do on a pop-up box 😞
You can set only 1 source on the list widget. So if I set my building in source, i cannot use the Offers.
So how can I access to the features of my offers if I'm on building list ? And the text widget embeeded on the list widget block the usage of $feature if you set more than 1 source.
Supporting the $dataSources variable in inner widgets of the List widget can lead to significant performance issues, so it is by design that only the $feature variable is accessible in this context.
And the text widget embeeded on the list widget block the usage of $feature if you set more than 1 source.
I was able to reproduce the bug and created an issue in our repository. As a workaround, if you add the Arcade expression first and then add other data sources to the Text widget, the expression should work as expected.
Thanks,
Shengdi
So it's impossible in the futur to have the FeatureSet serie of function ?
For your solution I don't really how you do. If I create a list of building and try to create a script who called my offers layers field which is not present in the widget i have an error. And if I create a list of building, create a script with only request about building field, add the offers source and edit my script by adding $feature.field_offers i have an error too.
I want to be able to request on the both sources of data.
Yes, the $feature variable does not support the Data Access function bundle and cannot be used with the FeatureSet series of functions. This limitation is also documented in the Data Access documentation:
When using a list widget that displays multiple features, the same limitation applies. Each feature is evaluated individually. This means the expression could trigger multiple simultaneous queries. This can lead to performance issues or failures.
My solution is to remove the $feature variable block when the text widget in the List is connected to multiple data sources. However, $feature simply does not support the FeatureSet series of functions.