This is definitely possible, but you'll need to use a Data Expression. You can see some examples here that may be helpful to you.
Can you elaborate on what these fields look like? When you say "combine", do you mean you want to aggregate the values in some way, or are they just text that you want to merge together?
something like this in one fields:
Aid | Bid | Cid | Aid, Bid, Cid |
x | y | z | x,y,z |
all fields are string and in one table. I am using table widget in dashboard
Not sure if this will work, but it's a starting point. You basically need to run through your features and concatenate those values for each, then push the features into a new FeatureSet.
// connect to layer
var fs = FeatureSetByPortalItem(
Portal('your-portal-url'),
'itemID of your layer',
0, // or whatever layer index it is
['*'], // you can limit the incoming fields to improve perfomance if you like
false
)
// get schema for layer
var out_fields = Schema(fs)['fields']
// add a new field to the schema to hold "merged" data
Push(
out_fields,
{name: 'aidbidcid', alias: 'Aid, Bid, Cid', type: 'esriFieldTypeString'}
)
// Use updated schema to create new dict
var out_dict = {
fields: out_fields,
geometryType: '',
features: []
}
// Iterate over features and concatenate new field, populate output dict
for (var f in fs){
// Create dictionary from existing attributes
var atts = Dictionary(Text(f))['attributes']
// Array of fields to concatenate
var ids = [
f['Aid'],
f['Bid'],
f['Cid']
]
// add new attribute to dictionary
atts['aidbidcid'] = Concatentate(ids, ',')
// push feature to output dict
Push(
out_dict['features'],
atts)
}
Return FeatureSet(Text(out_dict))