Adding custom fields on FeatureLayerDataSource

192
4
12-04-2024 07:15 AM
UmutUcok
Emerging Contributor

In visualization and popup, arcade are useful. But I need to add custom number field into FeatureLayerDataSource. That field then will be calculated by an arcade executor. 

Also, layer has data more than 1 million. So what I'm looking for is to get score by doing some math on couple fields, then sort them. Sort will require to iterate all features. So queryFeatures with 2000 request each or getRecords then setRecords can be used. I hope then we can createJSAPILayer based on that DataSource object.

I am trying to figure out extent of the solutions

0 Kudos
4 Replies
JeffreyThompson2
MVP Regular Contributor

You would probably be better served creating a calculated field on the original datasource in ArcGIS Pro, especially with that many features. 

GIS Developer
City of Arlington, Texas
0 Kudos
DavidSolari
MVP Regular Contributor

To expand on this, if you have access to attribute rules you can use that as well. You'll want to run some tests to see if the cost of calculating the value on feature insert/update is less than just calculating it through arcade.

0 Kudos
UmutUcok
Emerging Contributor

It's not about insert/update data. I've already arcade formula shows value in the column. Problem is while building FeatureLayerDataSource, I'd need to have that "visual" field then dynamically calculate under the hood of JimuCore.

We cannot run calculate field. It's a web application, you cannot modify data source.

0 Kudos
UmutUcok
Emerging Contributor

No. Calculation formula is dynamic. Your solution is static.

0 Kudos