getDataTableHtml Step

Use this step to fetch SQL data table and convert to HTML.

Last published at: June 7th, 2024

Description:

This step executes an SQL statement against the selected database. If it is a select statement, it returns the result set as an HTML table.

 

Inputs

  • connectionString – connection string to the database
  • changeDatabase - Connect to a different database on the same connection string path
  • sqlStatement – SQL statement to execute
  • params - SQL parameters and values
  • varGlobalHTML – variable/global to store the HTML table
 

 

Returns

  • True – SQL statement executed successfully
  • False – SQL statement failed to execute
 

 

Usage:

 

Example:

Let’s build and execute the getDataTableHtmlDef example.                             

  • Create a new definition called “getDataTableHtmlDef”
  • Select the definition and click the “design” button
  • Drag a “getDataTableHtml” step to the canvas
  • Connect the dots between the start and “getDataTableHtml” step
  • Define a variable/global to store the HTML result after execution
  • Click on the "getDataTableHtml" step to configure its "Settings" properties. Provide a name to the step. Select the connection string from the list. Provide the select SQL SELECT statement. Provide the variable/global to store the HTML result. 

 

  • The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new process instance, and execute. Render the process instance. Click on the process step to view its properties. The step should get the data table result set as an HTML table. 

 

  • To execute by parameters, Click on the "getDataTableHtml" step to configure its "Settings" properties. Provide a name for the step. Select the connection string from the list. Provide the select SQL SELECT statement as shown below, where the condition values are replaced with question marks. Provide the variable/global to store the HTML result. 

 

  • Click on the "getDataTableHtml" step to configure its "Advanced" properties. To connect to a different database, mention the DB name accessible on the same connection string. Click on the SQL parameters button to configure. 

 

  • Define SQL parameters and values. Provide parameter names and values to be used in run time.

 

  • Save the process definition, create a new process instance, and execute. Render the process instance. Click on the process step to view its properties. The step should get the data table result set as an HTML table from the other database, as configured. 

 

  • Save the process definition, create a new process instance, and execute. Render the process instance. Click on the process step. The step should execute the SQL query on the selected database server and return the result in JSON or XML based on the result format.

 

  • To execute a stored procedure, Click on the "getDataTableHtml" step to configure its "Settings" properties. Provide a name to the step. Select the connection string from the list. Provide the stored procedure info as shown below - with question marks identified as parameters. Provide the variable/global to store the HTML result. 

 

  • Click on the "getDataTableHtml" step to configure its "Advanced" properties. To connect to a different database, mention the DB name accessible on the same connection string. Click on the SQL parameters button to configure. Define SQL parameters and values. Provide parameter names and values to be used in run time.

 

  • Save the process definition, create a new process instance, and execute. Render the process instance. Click on the process step to view its properties. The step should execute the stored procedure and get the result set as an HTML table.