This is how I've accomplished this, its a little manual since you have to add the fields induvial but it loads quickly and works well for our applications (add an arcade element then add the code to that):
var fieldInfos = []
if (!IsEmpty (Trim($feature.facilityid))) {
Push (fieldInfos, {fieldName: 'FacilityID', label: 'Facility Identifier'})
};
if (!IsEmpty (Trim($feature.ownedby))) {
Push (fieldInfos, {fieldName: 'Owned By', label: 'Owned By'})
};
if (!IsEmpty (Trim($feature.presentstatus))) {
Push (fieldInfos, {fieldName: 'Present Status', label: 'Present Status'})
};
if (!IsEmpty (Trim($feature.comment))) {
Push (fieldInfos, {fieldName: 'Comment', label: 'Comment'})
};
if (!IsEmpty (Trim($feature.flowtestcomplete))) {
Push (fieldInfos, {fieldName: 'Flow Test Complete', label: 'Flow Test Complete'})
};
if (!IsEmpty (Trim($feature.inspectionResult))) {
Push (fieldInfos, {fieldName: 'Inspection Result', label: 'Inspection Result'})
};
if (!IsEmpty (Trim($feature.flowtestcomment))) {
Push (fieldInfos, {fieldName: 'Flow Test Comment', label: 'Flow Test Comment'})
};
if (!IsEmpty (Trim($feature.flow))) {
Push (fieldInfos, {fieldName: 'Flow Rate', label: 'Flow Rate'})
};
if (!IsEmpty (Trim($feature.flushingzone))) {
Push (fieldInfos, {fieldName: 'Flushing Zone', label: 'Flushing Zone'})
};
if (!IsEmpty (Trim($feature.firestation))) {
Push (fieldInfos, {fieldName: 'Fire Station District', label: 'Fire Station District'})
};
if (!IsEmpty (Trim($feature.lastflowtest))) {
Push (fieldInfos, {fieldName: 'Last Flow Test', label: 'Last Flow Test'})
};
return {
type: 'fields',
fieldInfos: fieldInfos,
attributes: {
'FacilityID': $feature.facilityid,
'Owned By': DomainName($feature, "ownedby"),
'Present Status': DomainName($feature, "presentstatus"),
'Comment': $feature.comment,
'Flow Test Complete': DomainName($feature, "flowtestcomplete"),
'Flow Test Comment': $feature.flowtestcomment,
'Flow Rate': $feature.flow + ' GPM',
'Flushing Zone': DomainName($feature, "flushingzone"),
'Fire Station District': DomainName($feature, "firestation"),
'Last Flow Test': (month($feature.lastflowtest) + 1) + '/' + day($feature.lastflowtest) + '/' + (Year($feature.lastflowtest)) + ' at ' + Hour($feature.lastflowtest) + ':' + Minute($feature.lastflowtest)
}
}