How to: Trigger Transforms in the Module Builder

Overview

To trigger a transform in the Module Builder, use the Plug-In component. In this article, you'll learn the different ways you can trigger your transforms in the Module Builder. You'll also configure your Plug-In for what you want the output of your transform to do. Here are a couple of ways you can trigger your transforms:

  • Execute with Input Data

  • Pre-Request Transform

Triggering a Transform Using an Execute with Input Data

One way to trigger your transform is to select Execute Transform with Input Data from the Internal Services drop-down menu. You can use this service to reference any transform in any module in your environment. You can also specify which fields you want to transform in your submission data Also known as Record Data. Submission data consists of information saved by Unqork components. View submission data by using the angular command, or in Record Collections.. To reference the transform and your fields, you'll enter the right inputs into your Plug-In. Then, using these inputs as the API call's request body your Plug-In component executes your transform.

In the Plug-In component's Inputs table, you'll enter the following: 

A static image displaying a Plug-In component's configuration window. The Internal Service is set to Execute Transform with Input Data

Let's move on to your Plug-In component's Outputs table. You'll fill in the Outputs table based on your transform type. For an Input transform, you'll map the information coming out of the transform to fields in your module. This overrides the original information. For an Output transform, you'll map the information coming from the transform to where it'll go. This could be text, JSON JSON (JavaScript Object Notation) is an open standard file and data interchange format. Unqork uses JSON for submission (record) data. data, or a PDF PDF (Portable Document Format) is a file format that allows users to share and print documents without modifying them..

Your Execute Transform with Input Data outputs your transformed data as an object An object is a type of data structure that represents a single, self-contained entity that acts as a container for the characteristics of that entity..

So, you'll enter the component Property ID in the Property ID column of the Outputs table. Then, you'll enter the data type of your transform in the Mapping column. You'll write your mapping based on the following data types: 

Data Type Mapping

JSON data

jsonData

Text

txtData

PDF

pdfUrl

You can also map your transform output to XML Extensible Markup Language (XML) is markup language that lets you define and store data in a shareable way. format. We'll cover mapping to XML in another lesson.

For example, say you use an Input transform that transfers data into JSON JSON (JavaScript Object Notation) is an open standard file and data interchange format. Unqork uses JSON for submission (record) data.. You want to store that data in a Hidden component. So, you'd enter dataTransform for the component's Property ID. Here's how the Outputs table would look: 

A static image displaying a Plug In component's Outputs table.

Now that you know how to trigger your transforms using Execute with Input Data, let's move on to a different method.

Triggering a Transform Using a Pre-Request Transform

You can also trigger Triggers activate another component when certain requirements are met. Trigger types include Concurrent, Post, and Error. Some components do not have the ability to trigger others. a transform in the Module Builder by selecting a transform from the Pre-Request Transform menu. To display the Pre-Request Transform menu, set your Plug-In component's Request Type to PATCH, POST, or PUT.

A Pre-Request Transform is the first in a two-step process. First, the Pre-Request Transform step transforms your data. Then, it uses your transform output as the input for your Plug-In component. That way, you’ll use the Pre-Request Transform to use your transformed data directly in an API call. To transform data with a Plug-In component, you’ll use Execute Transform with Input Data as the trigger.

To set up a Pre-Request Transform trigger in your Plug-In component, do the following: 

These instructions assume you have a new module open, saved, and with a title. These instructions also assume you have added a Plug-In component to your Module Builder canvas.

1. Open the Plug-In component that you'll use to trigger your Pre-Request Transform.
2. Select which Service Type you'll use for your transform.
3. Select which Internal Service or External Service you'll use for your transform, if applicable. Your Pre-Request doesn't require you to select a service.
4. From the Request Type drop-down, select PATCH, POST, or PUT. Selecting one of these options causes the Pre-Request Transform drop-down menu to appear under Service Type.
5. Select your transform from the Pre-Request Transform drop-down menu.

To select a transform, you must first create one in the Module Builder. For more information on how to create a transform, search for Transforms Sidebar Option in our In-Product Help.

A static image displaying a plug in component's pre-transform setting.

When you use a Pre-Request Transform trigger, the API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. call’s request body won’t need the Plug-In’s Inputs table. Instead, the API call’s request body is the output of your executed transform. So, when using a Pre-Request Transform, leave the Inputs table empty. Note that Pre-Request Transform only uses transform parameters as your request body. Meaning that you can only select transforms saved to the module you’re in.

As you just learned, the Pre-Request Transform uses your transform as the request body of your API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. call. That means your transform must include the input parameters to run as expected.