Select to view content in your preferred language

Arcade: Add a function to merge multiple Featuresets

428
0
04-15-2023 04:51 AM
Status: Open
JohannesLindner
MVP Frequent Contributor

Please add a function to merge multiple Featuresets together, analogous to the geoprocessing tool Merge.

Example case: Sometimes you have multiple services for the same problem (eg scheduled work projects) in different domains (eg wastewater, stormwater, water, gas, road). If you want to display these different Featuresets in a single table/list/chart, you have to create the output featureset, go through the featuresets and push each feature into the output featureset. It would be helpful to have a function like this:

 

// same fields -> without field map
var fs_1 = FeaturesetByPortalItem(..., ["Project", "StartDate", "EndDate"], false)
var fs_2 = FeaturesetByPortalItem(..., ["Project", "StartDate", "EndDate"], false)

var merged_fs = Merge([fs_1, fs_2])


// different fields -> with field map
var fs_1 = FeaturesetByPortalItem(..., ["Project", "StartDate", "EndDate"], false)
var fs_2 = FeaturesetByPortalItem(..., ["ProjectName", "Start", "End"], false)

var merged_fs = Merge([fs_1, fs_2], {"Project": ["Project", "ProjectName"], "Start": ["StartDate", "Start"}, "End": ["EndDate", "End"]})

 

Tags (1)