Select to view content in your preferred language

Arcade Expression in Workforce

1411
6
Jump to solution
01-23-2019 06:18 PM
MarcoPoetsch_ret
Occasional Contributor

Hi all,

I made an Arcade Expression in the _workers map.

However, when I click on the feature the popup shows just an empty field instead of the expression.

Is Arcade still unavailable in Arcade?

Cheers,

Marco

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
CraigGillgrass
Esri Regular Contributor

Marco, Workforce does not support Arcade expressions. We are working on that for our next release scheduled for this year.

Craig

View solution in original post

6 Replies
CraigGillgrass
Esri Regular Contributor

Marco, Workforce does not support Arcade expressions. We are working on that for our next release scheduled for this year.

Craig

mapmcburney
Occasional Contributor

Hello, has this be addressed or a solution found? I have the following arcade expressions in my Worker map. The pop up displays correctly in map but is blank in the Workforce app. I have tested this on the iOS version 22.1.1 and Android 22.0.1

First Expression

var returns =FeatureSetByPortalItem(Portal('https://www.arcgis.com/'), 'c9c0de299937441998b55a80689f9cdd', 2,['*'])


var site_id = $feature.site_id
var filterStatement = 'site_id = @site_id'
var relatedData = Filter(returns, filterStatement)

var relatedDataSorted = OrderBy(relatedData, 'visitDate DESC')
// return relatedDataSorted
var popupString = ''
for (var f in relatedDataSorted)

if (f.visitType != 'New'){
popupString += f.visitType + TextFormatting.NewLine +

'Visit Date: ' + Text(f.visitDate, 'DD/MM/YY') + TextFormatting.NewLine +

'Change Status: ' + DomainName(f, 'changeFieldStatus')+ TextFormatting.NewLine +


'Observed Crop Type: ' + f.finalObservedCropType + TextFormatting.NewLine +

'Observed Residue Type: ' + f.finalObservedResidueType + TextFormatting.NewLine +

'Comments: ' + f.comments + TextFormatting.NewLine +
TextFormatting.NewLine
}
return popupString

 

Second Expression

var returns =FeatureSetByPortalItem(Portal('https://www.arcgis.com/'), 'c9c0de299937441998b55a80689f9cdd', 2,['*'])


var site_id = $feature.site_id
var filterStatement = 'site_id = @site_id'
var relatedData = Filter(returns, filterStatement)

var relatedDataSorted = OrderBy(relatedData, 'visitDate DESC')
// return relatedDataSorted
var popupString = ''
for (var f in relatedDataSorted)
if (f.visitType == 'New'){
popupString += 'Visit Date: ' + Text(f.visitDate, 'DD/MM/YY') + TextFormatting.NewLine +

'Observed Crop Type: ' + f.finalObservedCropType + TextFormatting.NewLine +

'Observed Residue Type: ' + f.finalObservedResidueType + TextFormatting.NewLine +

'Comments: ' + f.comments + TextFormatting.NewLine +
TextFormatting.NewLine
}
return popupString

0 Kudos
ABorowik
Emerging Contributor

@CraigGillgrassIs Arcade supported in Workforce yet?  I am attempting to show the assignment history in a pop-up by looping through records from a table in the map.  So far this only works when the table is related to the feature class I am selecting.  I would like to use FeatureSetByName so I can grab values from unrelated tables also.
Thanks,
Ann

0 Kudos
CraigGillgrass
Esri Regular Contributor

Hello @ABorowik are you using ArcGIS Workforce or the Classic Workforce app?  If you tap on About, it will display the version number,

0 Kudos
ABorowik
Emerging Contributor

Hi Craig,
I am using ArcGIS Workforce in a browser, viewing the Dispatcher map.  The pop-up appears correctly in the Dispatcher map preview in configuration and also when the map is opened from AGO contents.  But when I open the Workforce project, the values from the arcade expressions are missing.

0 Kudos
ABorowik
Emerging Contributor

I have it working now.  Only FeatureSetByPortalItem seems to work.  FeatureSetById and FeatureSetByName are not working in the Dispatcher map.

0 Kudos