Using Action Flows to solve for gaps in PQL in Celonis
While Celonis' PQL has its definite benefits, i.e., quickly building complex joins, it does become troublesome just using queries for analyses. Not being able to do a simple iteration over a list or using the output of Query A as the input to Query B are big issues that cause us daily issues when developing in Celonis.
Action Flows to the rescue.
We've found a simple (ish) workaround to the lack of iteration available in the PQL environment: using Action Flows to iterate. There are some quick tips we can share to get you off the ground running with this new tool in your tool bench:
1. Create a Knowledge Model from your Data Model. This is an important step to open up the availability of Augmented Attributes and storing information dynamically during an action flow.
2. Create the Action Flow
a. The "Listen for Webhook" module is extremely useful for letting end users set off an action flow from an analysis. Use the button component and paste in the webhook URL provided to you by the action flow module. Be aware that there is no feedback in the analysis that it is running so you will have to alert users it may take some time.
b. Use the Celonis "Get Rows" module instead of the "Query Data Model" module. This lets you access KPIs that you have written and the Augmented Attributes within the specified Knowledge Model.
c. While Action Flows have a "Set Variable" module, it is one-time use only. You cannot reset variables and this severely limits their functionality. Our workaround is to use Augmented Attributes as a separate register that you can update using the built-in Celonis modules, i.e., "Update Augmented Attribute". We have done this with success, and it works quickly, plus you can use the end result in analyses.
d. Use the "Iterate" Flow Control module as a loop to go over the results of your initial query. You can specify which module's results to iterate over. You can also nest iterate modules as you would nest for loops!
3. Show the results in an analysis by accessing the new table created for the Augmented Attribute. Not only will this let you see the value that was added, but if it gets changed after a 15 minute threshold, it will show you the updates.
And just like that, you are able to iterate over queries that you write in PQL within Celonis!