Access Variables created in Task Action

1311
5
02-08-2019 10:18 AM
thejuskambi
Occasional Contributor III

Hello,

ArcGIS Pro provides ability to create/store values in variables, within a Task Action (using Task Designer).

I would like to know how these variables can be used?

Also, are these variables accessible in a Custom Addin Command or Geoprocessing Tool? if yes, How or what objects expose them?

Thanks in advance.

Thejus

0 Kudos
5 Replies
NarelleChedzey
Esri Contributor

Hi Thejus, 

Variables defined with Task Designer are only available for use with the task they are defined with.  They are used internally by the Tasks module.   The variables are not available with the Pro SDK. 

Thanks

Narelle

thejuskambi
Occasional Contributor III

Hello Narelle,

Thanks for the response. I agree with your response but, does that mean the following statement in the help document is false.

A step can load a dialog box prompting the user to enter an attribute. The entered attributes can be saved in variables to be used in subsequent steps. For example, a step would get an attribute from a task user and use it to calculate attribute fields in a subsequent step.

Configure a step command—ArcGIS Pro | ArcGIS Desktop 

Then, how do I use these variables, other than to calculate the field value?

Warm Regards,

Thejus

0 Kudos
NarelleChedzey
Esri Contributor

Thejus, 

The help is a little misleading - When the Get Attributes action is chosen in designer mode, a dialog box is displayed for the designer to specify a table, field, variable combination.   When the step is executed the fields configured are displayed to the user in a grid.  The values input by the user are assigned to the variables internally by the Tasks module. 

The only current use for these variables is to be used by the task designer in subsequent steps in a calculate field action. 

Hopefully this clarifies the role of variables in the Get Attributes and Calculate Field actions.    I will make sure the help is updated to explain this more clearly. 

Thanks

Narelle

by Anonymous User
Not applicable

OK so how do we use variables in a calculate field action?

0 Kudos
by Anonymous User
Not applicable

Never mind I think I found it: when you select Calculate field in the Add Task dialog, you set all the Input selections and the field to be updated, then scroll through the list of Fields to calculate into the update field and find the variables you created in prior steps; they'll be called #variablename#