loading..
< View all articles in Workflow Automation.

Dynamic Responses in Lead Automation Actions

You can save the dynamic responses from webhooks or Lapps and use them to insert dynamic content through various automation actions. This article shows you how to first save a Lapps or Webhook response and then use that response in the following actions –

  • Update Lead
  • Create Activity
  • Update Activity
  • Pass to another webhook
  • Pass to another Lapp

You can also use dynamic responses in the emails you send your leads. For more information on this, see Dynamic Content in your Emails.

 

Saving a Lapps or Webhook Response

You can save responses from Lapps and Webhooks in automations and then use these responses in various automation actions. Here’s how you save a response –

  1. Access an existing automation or create a new one by navigating to Marketing>Automation.
  2. Add a Custom automation action card and select either the Call Lapp or Webhookoption.
  3. Toggle the Save Response option to Yes and choose whether you want to save the response as
    1. Plain text – Doesn’t allow you to separate out key-value pairs from the content.
    2. JSON data – Allows you to separate out key-value pairs.
  4. Click Save to add the action card to your automation.
  5. Once the automation card is saved, click the more icon () and then click View Dynamic Responses. All the dynamic responses and the places they’ve been referenced will show up here.

 

Update Lead

Business use cases for this feature will be available soon…

Once you’ve saved a webhook or Lapp response, you can use it in the Update Lead action to update a lead field –

  1. After creating a webhook or a Lapp and saving the response, under Lead Actions, select Update Lead.
  2. Select the Lead Field you want to update with dynamic content.
  3. In the Value field, type @ and scroll to the bottom of the list of auto-suggestions. You’ll find the dynamic responses you’ve saved under Mail Merge (Dynamic Responses).
  4. Click Save.

Add Activity

Business use cases for this feature will be available soon…

You can use the dynamic responses from webhooks and Lapps in the Create Activity action. For example, you can populate the ‘Comment’ field of a ‘Chat Conversation’ activity with the dynamic response saved from a webhook or a Lapp –

  1. After creating a webhook or a Lapp and saving the response, under Lead Actions, select Add Activity.
  2. Select an Activity Type then click the Add an additional field link.
  3. Select an Activity Field and the type to see the list of mail merge fields. You’ll find the dynamic responses you’ve saved under Mail Merge (Dynamic Responses).
  4. Click Save.

Add activity dynamic responses

 

Update Activity

Business use cases for this feature will be available soon…

Follow these steps to use a Lapp or webhook saved response to update an activity –

  1. After creating a webhook or a Lapp and saving the response, under Lead Actions, select Update Activity (the automation trigger must be an activity).
  2. Select the Activity Field you want to update with dynamic content.
  3. Click the Add Mail Merge checkbox.
  4. In the Value field, type @ and select the webhook or Lapp saved response.
  5. Click Save.

Update Activity

 

Pass to Another Webhook

You can pass the saved response from a Lapp or webhook as a query string to subsequent webhook you create. The parameters you pass will be appended to the webhook URL –

  1. After creating a webhook or a Lapp and saving the response, under Custom, select Webhook.
  2. Enter the saved response after the webhook URL. For instance, enter requestbin.in?id=@{PostWebhook2_Response<<node>>,} , where requestbin.in? is the webhook URL and id=@{PostWebhook2_Response<<node>>,} is the dynamic response.
  3. Click Verify and then click Save.

Dynamic Content

 

Pass to Another Lapp

Business use cases for this feature will be available shortly…

You can pass the response from a webhook or Lapp to another Lapp –

  1. After creating a webhook or a Lapp and saving the response, under Custom, select Call Lapp.
  2. Select the Lapp you want to call from the dropdown.
  3. Enter the dynamic response from the previous Lapp/webhook in the Query String field. For example, id=@{PostWebhook2_Response<<node>>,}
  4. Click Save.

Note: You can save the response from this Lapp and then use it in further webhooks or Lapps you create.

Call Lapps

 

Examples

Your saved response will look something like this –

@{PostWebhook13_Response<<MyDynamicNode>>,}

Note: The response names (PostWebhook2 here) will vary based the Id of the Lapps or webhook automation cards you create.

Here are some examples of how you can use <<MyDynamicNode>>

Example 1

If the JSON data being posted by your Lapp or Webhook looks like this –

{
“Key1”: [“Value1”, “Value2”, “Value3”],
“Key2”: {
“Key4”: “Value4”,
“Key5”: [“Value5”]
}
}

Then you can use pass <<MyDynamicNode>> as –

  • @{PostWebhook2_Response.Key1[0],} -> Value1
  • @{PostWebhook2_Response.Key2.Key4,} -> Value4
  • @{PostWebhook2_Response.Key2.Key5[0],} -> Value5

Example 2

If the JSON data being posted by your Lapp or Webhook looks like this –

[{
“Key”: “Value1”
}, {
“Key”: “Value2”
}]

Then you can use pass <<MyDynamicNode>> as –

@{PostWebhook2_Response[1].Key,} -> Value2

Example 3

Or you could just post all the data like this –

@{PostWebhook2_Response,}

 

Errors

If you delete a webhook or Lapp card whose saved response was being used in an email or if you turn the Save Response option Off, you’ll see the following error notification –

dynamic response missing

You can also locate the cause of the error by clicking the more icon () and then clicking View Dynamic Responses. You’ll be able to see which card is was deleted or had the saved response option turned off.

errors in dynamic responses

If you have questions or need more assistance, please reach out to us at support@leadsquared.com. We’re always eager to help!