Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Alteryx Workflow Configuration - Save the value of all Constants used in the run

sg1525
6 - Meteoroid

Hi All,

 

I want to save the Constants values used during the execution of workflow for audit trail purpose.

Is there a way to configure Alteryx workflow so that all parameters (at least the constant and its value) are saved into a file from runtime?

5 REPLIES 5
Yoshiro_Fujimori
15 - Aurora

Hi @sg1525 ,

 

You can read the constants in the expression as below;

TimeStamp = DateTimeNow()

Filename = [Engine.WorkflowFileName] + "_" + [TimeStamp]

TempFilePath = [Engine.TempFilePath]

Version = [Engine.Version]

WorkflowDirectory = [Engine.WorkflowDirectory]

WorkflowFileName = [Engine.WorkflowFileName]

GuiInteraction = [Engine.GuiInteraction]

 

So you can set the value in the workflow and output to the log file as the attached workflow.

SaveConstants_Workflow.png

 

I hope this helps.

sg1525
6 - Meteoroid

Hi Fujimori San,

 

Thanks for your response on my query but I was actually looking for some tool within Alteryx which can output all Workflow level configuration without any initialization of each variable into formula tool.

The issue with this approach is , I have 50+ workflows and each of them have there own configuration parameters, now if I want the constant values to be as part of workflow output I need to create individual formulas for each workflows referring to all the available constant values in it.

 

Also if there are 30-40 variables as part of configuration I need to create formula for all those variables. 

Is there a tool available which stores this value in Alteryx and directly output to a file irrespective of number of configuration item.

A_Galanidis
5 - Atom

Hi sg1525,

 

This solution might help you. I think you can save the constant values used during the execution of an Alteryx workflow by using the "Log Message" tool.

Here's how you can do it:

- Add a "Log Message" tool to your workflow.
- In the "Log Message" tool configuration, select "User Messages" and create a message that includes the constant values you want to log. For example, you could create a message like "Constant Value: [ConstantName] = [ConstantValue]".
- Connect the "Log Message" tool to the output of the tool that uses the constant value you want to log.
- Run the workflow.
After the workflow has finished running, you can view the log messages in the "Results" tab of the workflow results window. You can also save the log messages to a file by right-clicking on the "User Messages" section of the results and selecting "Export".
This will allow you to save the constant values used during the execution of your workflow for audit trail purposes.

 

The "Log Message" tool in Alteryx can store values and directly output them to a file, regardless of the number of configuration items.

When you configure the "Log Message" tool, you can specify which values you want to log and how they should be formatted. You can include constants, variables, or any other data that you want to track. You can also customize the format of the log messages to suit your needs.

Once you have configured the "Log Message" tool, you can connect it to any tool in your workflow and it will log the values you have specified. The log messages will be written to the results window, and you can export them to a file if you want to save them for future reference.

 

I hope this helps.

danilang
19 - Altair
19 - Altair

Hi @sg1525 

 

Try this standard macro.  Drop it into any workflow and it will read the constants from the main workflow file, .yxmd, yxwz, etc.

InAction.png

 

Internally it's quite simple.

W.png

It builds the path to the current main workflow by using the [Engine.Workflowdirectory] and [Engine.WorkflowFileName] and passes these to a Dynamic Input that opens the file as an xml and returns the values of the <Constant> nodes. 

 

All you need to do is figure out a way to output the constants in a consistent way for all your workflows. 

 

Dan 

sg1525
6 - Meteoroid

Thanks a lot Danilang.

 

Solution worked perfectly for me.

The only issue I have now is that this approach provide me config values from the saved workflow, however execution team update the values during run time and do not save the graph, so with this approach I wont be getting the values used during execution but it will be values which are saved under yxmd file. I think if I need to capture the values during execution time only a different solution is required.

 

Good part is that I can have list of all User Constants from this Macro but still the run time values need to be captured for all these constants 

Labels