PM with Automation Cloud - How to implement update query with Jinja SQL for Tranformation in PM App

Can some one help here on how to implement Update query with Jinja SQL for Process Mining Transformation, I am trying to implement Transformation to refelect data in PM app, however getting following error:

(‘42000’, "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword ‘UPDATE’. (156) (SQLMoreResults); [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword ‘case’. (

please refer my query from visual studio code:

Hey Nisha,

Each .sql file should result in one final select query that defines the new table in the data model. An insert/update statement will be derived from that automatically.

Your final table should be named the same as the .sql file, Case_Transformation_table in your case.

So for example you could add something like this to your select statement:

            when Cases_raw."Case_value" > 500 then "Big Invoice"
            else NULL 
        end as "Big invoice"

Please check this docs page for more details:

Hello @Martijn_Wijffelaars thank you so much for your reply, yes i have also come across the Case syntax trying it however it is giving me error:

also, to add my column name i s custom_case_text_1 and the value that i want to set to it is Big Invoice as per condition

Please suggest.

@Martijn_Wijffelaars , please refer below image:

as suggested by you tried to update query, still showing error as given.

Hello @Martijn_Wijffelaars very happy to share that, able to execute query successfully and also able to reflect same in SQL server, please refer attached screen shot:

thank you for support!

1 Like

Nice one! Thanks for sharing the result.

1 Like

Btw, you should be able to refer to the fields without the pm_utils functions. They only needed when you need to convert from one data type into another.

Cases_raw."Case_value" should work.

Will try that too.

Also, @Martijn_Wijffelaars now that I am able execute transformations successfully, but still after importing transformations to PM app, can not see newly added table with PM app, where and how will it be reflected.

Also, have tried to upload the data once again after import transformation

Hey Nisha, for 23.4 the data model in Process Mining is fixed,
to add new fields to existing tables, please use the so-called “custom fields”, see

PS. The feature “Flexible data model” which is targetted for 23.10 will make it possible to add new fields and tables to the data model of an app.

1 Like

Thank you so much, @Martijn_Wijffelaars for the updates, so If I am not wrong your saying with current version of PM automation cloud, it does not reflect the new added transformation (tables/feilds) in PM app post import, is this correct understanding?

and this will be reflected with upcoming version of PM app?

Also, for now if I want to see the reflection of Transformation with my PM App, what kind of transformation I can perform right now, if you could please give me any sample of transformation?

Many thanks for your kind support!

That’s correct, the way to add new fields to your app now is to output them as Custom fields in existing tables.

Adjust the transformations of your app such the new inputs are outputted as the correct fields.

1 Like

ok, it means, if we added new transformations (new tables/ fields) through .sql file with dbt it won’t reflect now, as I have added new table with new sql file in dbt project and it properly reflected the same in my SQL Database schema however same is not reflecting with PM App.

And for now the only way is to use the Custom fields and manually map them for new transformations right?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.