This is an old revision of the document!


execute & Store Mysql Query

Only use this task if you could work with MySQL!

This task executes a query against the database and save the first row of the result into an environmental variable, which could be used by other tasks.

This feature also create a the function “wf_dbquery” inside custom expressions, which does exactly the same. (See custom expressions page for documentation)

Example

You execute a query which get a row with the columns “colA”, “colB”, “colC”, “colD” and you save this to the environmental variable mysqlresult.
You could use these values by $env[“mysqlresult”][“colA”] or $env[“mysqlresult”][“colB”] …

Here you get an example Organization Workflow, which will execute two simple queries and save one result into the description field and the other into a new comment.
Download Example
Also the new function “wf_dbquery” is included in this example, which create a second comment with the CRMID and type of the latest record.