When to use this Flow type
Use this Flow type when you want to merge the global variables with the template which contains the {tokens}
and send the resulting payload to any of the following destination Connections:
- Amazon S3
- Google Cloud Storage
- Microsoft Azure Storage
- Server Storage
- FTP
- FTPS
- SFTP
- WebDAW
- HTTP (web service)
- Outbound email
- Box
- Dropbox
- Google Drive
- OneDrive for Business
- SharePoint
- Redis
- MongoDB
For example, let's assume that you want to send a request to the POST HTTP endpoint which requires the following payload:
{ "invoiceBECode": "{invoiceBECode}", "effectiveDate": "{Product Purchase Date}", "purchaseDate": "{contract purchase date}", "invoiceNumber": "{member purchase order number}", "customer": { "businessEntityReference": "{Member Email}", "typeCode": "customer", "parentBE": { "code": "{invoiceBECode}", "typeCode": "dealer" }, "intl": [{ "name": "{Member First Name} {Member Last Name}" }], "addresses": [{ "entityAddress": { "type": "Billing", "address1": "{Member Address 1}", "city": "{Member City}", "zip": "{Member Post Code}", "state": { "code": "{Member State}" }, "country": { "code3": "USA" }, "email": "{Member Email}" } }] }, "servicePlanProducts": [{ "entitlements": [{ "entityEntitlement": { "policyType": "Extended", "policyCode": "{OPW SKU}", "termCode": "{OPW SKU}", "termType": "Extended", "quantity": "1" }, "entitlementAmount": { "adjustedAmount": "{Retail Price}" } }] }] }
Notice the {tokens}
in the payload.
The easiest, approach by far would be to create an HTTP Connection which points to the POST API endpoint and use Flow type Merge data with template
, together with the JavaScript Flow or loop, to create an actual payload by merging the {tokens}
with the global variables and send it to the HTTP Connection. In fact, the destination Connection can be any of the file-based Connections above, NoSQL database, or even the outbound email Connection.
Process
Step 1. Create the destination Connection. It can be any of the Connections above.
Step 2. Start creating a new Flow on the Flows
page by clicking +
and typing in template
.
Step 3. Select the Flow, select the Parameters
tab, and enter the Template
and the optional File Name
(the file name is required for file-based Connections).
You can use {tokens}
as part of the template. Tokens will be automatically substituted on the values of the global variables at run time.
Step 4. Optionally, enter the JavaScript or Python program in the Script
field. This program will be executed before merging data with the template. You can use it to set the global variables that can be used as {parameters
in the Template
and File or {tokens}
in the Destination Connection. You can also use it to conditionally disable the Flow.
Step 5. Select the Connections tab and select the destination Connection created in step 1.
Comments
0 comments
Please sign in to leave a comment.