Integrate Rampiva Automate with Quickbase

The material in this document is for informational purposes only. The products it describes are subject to change without prior notice, due to the manufacturer’s continuous development program. Rampiva makes no representations or warranties with respect to this document or with respect to the products described herein. Rampiva shall not be liable for any damages, losses, costs or expenses, direct, indirect or incidental, consequential or special, arising out of, or related to the use of this material or the products described herein.

Introduction

This article describes how track the status of running Rampiva Automate jobs in a Quickbase application using a Quickbase pipeline and a Rampiva workflow-side script.

For a guide on how to submit a job in Rampiva Automate when a record is created in Quickbase, see https://rampiva.atlassian.net/wiki/spaces/KB/pages/1071808635

Prerequisites 


Instructions

A. Create a Quickbase Application to Store the Data

1

In Quickbase, open the My Apps tab.

2

Select Create new app.

3

Select Start from scratch.

4

Name the application Rampiva Tracker.

5

Add a Jobs table.

The Jobs table will be used to store the status of Rampiva Automate jobs. The fields we will use in the Jobs table in this guide are an example, and can be adjusted to fit the business need.

 

6

Add following fields to the Jobs table:

  • Job ID - Text

  • Name - Text

  • Status - Text

  • Progress - Percent

  • Volume Loaded - Numeric

  • Volume Exported - Numeric

  • Operation Number - Text

  • Operation Name - Text

  • Operation Progress - Percent

The Job ID field will be used to link the Quickbase job records with the Rampiva Automate jobs. To ensure that we don’t have duplicate records in Quickbase, we need to set the Job ID field as a key. This setting cannot be performed during the table creation, and we will perform this in the subsequent steps of this section.

7

Click Create app to save the current settings.

 

8

Modify the Jobs table by clicking on the settings icon at the top-left.

 

9

Select Structure to modify the structure of the table.

 

10

Check the Job ID field and click on Set Key.

11

Confirm that the Job ID field has the key icon in the fields list.

B. Create a Quickbase Application Access Token

1

In Quickbase, open the My Apps tab.

 

2

Click on the user dropdown and then click My Preferences

3

Under the My User Information section, click on Manage my user tokens for …

4

Click New user token

5

Name the token Rampiva Tracker Token

6

Assign the token to the Rampiva Tracker app. This is the name of the application that was created in the previous section.

7

Click Save and take note of the token value.

C. Create the Quickbase pipeline

1

In Quickbase, open the Pipelines tab.

2

Create a new pipeline named Update Tracker from Automate.

3

In the Channels panel, search for quickbase, expand the Quickbase section and click Connect to Quickbase.

4

Fill out the User Token section with the value of the token create in the previous section, and click Connect to Quickbase.

 

5

From the JSON Handler channel, from the JSON Sources section, add the Incoming JSON step at the beginning of the pipeline.

 

6

Take note of the Endpoint value. This is the entry point to the pipeline.

7

From the JSON Handler channel, from the JSON Objects section, add the Iterate over JSON records step.

8

In the JSON Schema Sample, add the following sample JSON:

{ "id":"aaa-bbb-ccc", "name":"Sample Job Name", "status":"Running", "progress": 10.33, "volumeLoaded": 123.45, "volumeExported":50, "currentOperationNumber":"2/10", "currentOperationName":"Add Evidence", "currentOperationProgress": 70.00 }

 

9

In the Do branch of the For each step, add the Search Records step from the Quickbase channel, from the Records section.

 

10

Select the account Rampiva Tracker Token, the table Rampiva Tracker: Jobs and in the Fields section add all the fields that we created in this table, to use in subsequent steps in the pipeline:

  • Job ID

  • Name

  • Status

  • Progress

  • Volume Loaded

  • Volume Exported

  • Operation Number

  • Operation Name

  • Operation Progress

 

11

In the Query section, add the condition Job ID equals {{b.id}}

12

Delete the For each loop of step C Search Records by clicking on the trashcan icon.

 

13

Add a condition after step C Search Records by clicking the Insert a condition button.

 

14

Click Add conditions, select C Record and set the condition to C List of Records is empty.

15

Under the Then branch, add the Create Record step from the Quickbase channel.

16

Map all of the record fields with their corresponding counterparts from the JSON record from step B.

 

17

In the Else branch add a loop by clicking the Insert loop button.

 

18

Under the Do branch, add the Update Record step from the Quickbase channel, from the Records section.

 

19

Add the following fields to be updated, and map them totheir corresponding counterparts from the JSON record from step B:

  • Status

  • Progress

  • Volume Loaded

  • Volume Exported

  • Operation Number

  • Operation Name

  • Operation Progress

 

 

20

Turn on the pipeline by switching the On toggle in the top bar.

D. Test the Pipeline

1

Open the website https://reqbin.com

 

2

Replace the sample URL https://google.com with endpoint URL of the pipeline created in the previous step.

3

Set the method to POST.

4

In the Content tab, use the following sample data to create a new record with:

{ "id":"aaa-bbb-ccc", "name":"Sample Job Name", "status":"Backlog", "progress":0, "volumeLoaded": 0, "volumeExported":0, "currentOperationNumber":"", "currentOperationName":"", "currentOperationProgress": 0 }
5

Click Send to submit the data and run the pipeline.

6

Return to Quickbase and inspect the Running pipeline tab. This tab should show the execution status of the various steps that we added to the pipeline.

7

Wait for the pipeline execution to complete.

 

8

Open the My apps tab.

9

Open the Rampiva Tracker app.

10

Open the Jobs table.

11

Return to the website .

 

12

Set the contents to the following JSON data, to test updating an existing jobs record:

{ "id":"aaa-bbb-ccc", "name":"Sample Job Name", "status":"Running", "progress": 10.33, "volumeLoaded": 123.45, "volumeExported":50, "currentOperationNumber":"2/10", "currentOperationName":"Add Evidence", "currentOperationProgress": 70.00 }
13

Click Send to submit the data and run the pipeline.

14

Wait for the pipeline execution to complete, and inspect the Jobs table.

 

E. Enable Pipeline Authentication

1

In Quickbase, open the Pipelines tab.

 

2

Edit the Update Tracker from Automate pipeline by clicking three dots and Edit.

3

Expand Step A Incoming JSON.

4

Change the Authentication schema to HTTP Basic.

5

Define a Username and Password of your choice, and take note of these values.

6

Turn the pipeline back on.

 

7

To confirm that authentication is required, return to the website and attempt to submit data using the same settings used in the previous section, without providing a username and password.

 

8

To test the request with valid authentication, open the Authorization tab and fill out the Username and Password defined in the pipeline in this section, and submit the same data.

 

F. Configure the Rampiva Automate Workflow-Side Script

1

On the Engine server that will run the jobs, create the script file C:\Scripts\quickbase-update.py.

 

 

2

Update lines 8 to 10 from the script with the endpoint URL, the username and the password defined in the pipeline.

 

Sample settings used in this guide:

3

In Rampiva Automate, edit the Execution Profile used, and set the parameter {wfn_execution_script_file} to C:\Scripts\quickbase-update.py

 

 

4

Submit a Job with the updated Execution Profile.

5

Wait for the Job to start running, and then inspect the Quickbase Jobs table.

6

The Volume Loaded and Volume Exported fields are not automatically calculated. The workflow-side script expects this values to be available in the user-defined {volume_loaded} and {volume_exported} parameters. To update these values, add a Script operation in the Rampiva Workflow with the required logic to set these parameters. See for more information.

 

G. Troubleshooting

1

By default, the workflow-side script does not output logs. Update the variables debugToExecutionLog, debutToLogFile and debugLogFile as needed for troubleshooting.

Sample code to enable logging to both the Job Execution Log as well as to file in C:\Temp\logs:

2

If no log file is created when running a Job, inspect the Rampiva Engine log for python errors.

 

3

If the debug log file indicates that data is sent to Quickbase but data is not visible in Quickbase, inspect the Quickbase pipeline activity for operations in progress and errors.

 

4

If needed, compare the your pipeline export code, with the export code of the pipeline created in this guide.