When to use this flow type
Use this flow type when you want to merge the global variables with the template with 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.
Creating flow
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 the +
button 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.