Dynamic job properties

ArcGIS Arcade expressions allow you to create placeholders for dynamic properties in job templates and the steps and paths in your workflow diagrams. For example, the Run GP Service step can be configured to use the jobLocation($job) Arcade expression as an input parameter that's replaced with the job's location when the step is run.

Tip:

You can also use the Arcade Date and Text functions to convert the output of an Arcade expression to a string and optionally change its format. For example, the Text(Date(jobEndDate($job)), 'dddd, MMMM D, Y') Arcade expression converts the job's end date from 1589414631 (epoch) to Thursday, May 14, 2020.

The following is a list of ArcGIS Workflow Manager components that support ArcGIS Arcade expressions:

  • Job templates
  • Paths
  • Step templates

The following table contains examples of ArcGIS Arcade expressions that can be used in Workflow Manager:

Arcade expressionDescriptionExample inputExample output

$currentPortal

A variable that is set to the current active portal when used with Arcade expressions that requires a portal instance to be defined.

GetUser($currentPortal)['email']

jdoe@esri.com

$currentUser

Returns the full name of the current user.

$currentUser

John Doe

$job

Returns the job ID for the current job.

$job

RRpFaSk1QK2IIHZTJX4flQ

$parentJob

Returns the parent job ID for the current job.

Note:

$parentJob can be used in place of $job in your expressions to obtain parent job properties.

$parentJob

ZZfPSka12KQHHITZXJf4qL

geoJsonToEsriJson('<feature_collection>', '<geometry_type>')

Returns the first feature from the feature collection that corresponds with the specified geometry type.

geoJsonToEsriJson(jobExtendedProperty($job, 'assets', 'geojson'), 'Point')

{\"x\":1.1354588060913904e7,\"y\":55660.45186542052}

GetUser($currentPortal)['username']

Returns the current user's user name.

GetUser($currentPortal)['username']

jdoe

GetUser($currentPortal)['email']

Returns the current user's email address.

GetUser($currentPortal)['email']

jdoe@esri.com

GetUser($currentPortal, '<user_name>')['username']

Returns a user's user name.

GetUser($currentPortal, 'jdoe')['username']

jdoe

GetUser($currentPortal, '<user_name>')['email']

Returns a user's email address.

GetUser($currentPortal, 'jdoe')['email']

jdoe@esri.com

var u = GetUser($currentPortal); return u['<key1>'] + ['<key2>']

Returns a string of information for the current user using a key.

Learn more about the GetUser function

var u = GetUser($currentPortal); return u['username'] + ': ' + u['email']

jdoe: jdoe@esri.com

var u = GetUser($currentPortal, '<user_name>'); return u['<key1>'] + u['<key2>']

Returns a string of information for a user using a key.

Learn more about the GetUser function

var u = GetUser($currentPortal, 'jdoe'); return u['username'] + ': ' + u['email']

jdoe: jdoe@esri.com

jobComment($job, '<step_id>')

Returns the last comment associated with a job or step.

Note:

The step_id parameter is an optional parameter. The last comment is returned by default.

jobComment($job, 'f50d740d-cc04-9296-4ce3-181e82604465')

The submitted feature edits are ready for review.

jobCreator($job)

Returns the user name of the person who created the job.

jobCreator($job)

jdoe

jobDescription($job)

Returns the job description.

jobDescription($job)

This is a landbase editing job

jobEndDate($job)

Returns the job closed date in epoch format.

jobEndDate($job)

1589414631

jobExtendedProperty($job, '<table_name>', '<field_name>')

Returns the value of an extended property for the job.

jobExtendedProperty($job, 'purchase_order', 'date')

1589414631

jobLocation($job)

Returns the location defined for the job in MinX, MinY, MaxX, MaxY, WKID format.

'https://<WebAdaptorHost.Domain.com>/<PortalWebAdaptorName>/apps/webappviewer/index.html?extent=' + jobLocation($job)

9862243.197380835,5108823.353604797,-9801843.791879544,5133768.0805264525,3857

jobName($job)

Returns the job name.

jobName($job)

JOB_1

jobOutputValue($job, '<step_id>', '<value_name>')

Returns the step output value for a completed step.

value_name is an optional parameter for step templates that include more than one output value.

jobOutputValue($job, 'd27395ec-ddfe-2b11-777a-6df02e86d835', 'num_acres')

123

jobOwner($job)

Returns the user name of the person who owns the job.

jobOwner($job)

jdoe

jobPriority($job)

Returns the job priority (high, medium, or low)

jobPriority($job)

Low

jobRelatedProperty($job, '<table_name>', '<field_name>', '<row_id>')

Returns the value of a related property for the job.

Note:

row_id is an optional parameter. The most recent record is returned by default. To retrieve extended properties, use the workflow_guid associated with the related properties table.

To retrieve feature service extended properties or an ArcGIS Survey123 property, use the Link Id for the row_id parameter.

jobRelatedProperty($job, 'Redlands', 'Population', '8fGjVNvzSjGYRpDoSDfSdA')

71198

jobReturnValue($job, '<step_id>')

Returns the return value for a completed step.

jobReturnValue($job, 'f50d740d-cc04-9296-4ce3-181e82604465')

S000001

jobStartDate($job)

Returns the job start date in epoch format.

jobStartDate($job)

1589414631

jobStatus($job)

Returns the job status.

jobStatus($job)

Ready to work

jobType($job)

Returns the job template name.

jobType($job)

Data_edits

jobVersion($job, '<datasource_name>')

Returns the active job version.

jobVersion($job, 'Gas_Utility_Network')

jdoe.JOB_1

lastRunner($job, '<step_id>')

Returns the user name of the person who last ran the step.

lastRunner($job, 'f50d740d-cc04-9296-4ce3-181e82604465')

jdoe

setting('<setting_name>')

Returns the value of the specified user-defined setting.

Learn more about user defined settings

setting('data_path')

c:\data

userGroups($currentUser)

Returns the ArcGIS Enterprise portal group IDs for the current user.

userGroups($currentUser)

abcde12345