community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Accessing and creating workflow constants in Python node

Meteoroid
Hi all,

Wondering if anyone could advise on accessing and creating workflow constants in the python node.

A few questions:

1) How can I get the value of a given workflow constant x?
2) how can I define a new workflow constant y =5?
3) how can I get a list of all constants defines in the workflow?

Regards,

Revlin
Moderator
Moderator

Hi @RevlinAbbi,

 

Thank you for posting!

 

There are 3 functions -as for 2019.2- to retrieve constants values from Python code:

 

from ayx import Alteryx

# Return a dict of Alteryx workflow constants
# and corresponding values
Alteryx.getWorkflowConstants()

# Return a list of workflow constants names
Alteryx.getWorkflowConstantNames()

# Retrieve the value of a specific workflow constant 
# Example for Engine.GuiInteraction
Alteryx.getWorkflowConstant('Engine.GuiInteraction') 

 

Note that with earlier versions, only Alteryx.getWorfklowConstant() is available.

 

For now, workflow constants must be created from Workflow - Configuration, Workflow tab.

 

Thanks,

 

Paul Noirel

Sr Customer Support Engineer, Alteryx

 

Labels