How to create a Workflow that uses Custom Object data to retrieve data from a Custom Action.

  • 14 June 2024
  • 0 replies
  • 80 views

Hey there 👋Femi here from the Technical Support Engineering  team!

 

We get some questions about using Custom Actions with Custom Objects and Workflows, here’s how to do that.

 

Let’s start by taking a look at what my custom API response to the /products endpoint of my test API looks like 👇 This is important as the request and response type will determine how you structure the Custom Action request.

 

AD_4nXdQzF4z02Ylv_TEGiKc32tHFx9hIelTNW45b0q6HUsahISeJWPQ84USAcACxGGseyA9OkvgIak5mgq4_zrh-rWN-n5VCMYyr4mONENpjpSVH5OXMpeMwJJDFocT8M3KJGEaI2sxBwKeiXBxI6P959I4b2Jw?key=ih94EB8R9t3SsAOHwe9Pnw

 

Now that we know what the response looks like, let’s go ahead and set up our Custom Action.

 

First, navigate to Settings and go to Apps & Integrations where you’ll find “Custom Actions”:

AD_4nXczPv1PfRm0j7VWTn24qF3_Go7IVofg5qdQh8iW3G-bGKZ2UDnZ56_R7CwRJ6EUN5b6ShIOrcge5oSRHnvsqCH4R849_eMSvj78tS6hF8OR_M-9MXWXSVkHdPV9NrOa2XCowDv8sRsDuavsiYzVv_ebUlSh?key=ih94EB8R9t3SsAOHwe9Pnw

 

This is where you'll set up all the different connections you have to external data (e.g. Shopify, Salesforce, etc.) depending on your use case. In this post, I’ll be making use of my custom online store that sells football boots.

Click “Create action” to set up your first Custom Action:

AD_4nXda3lenZ-PYH9mFCJiAYjY74Fa_gZnjsQowN50-IyhT1lvpK3ZwXGMPb81EcJvQSc9rR-kB4SdhaNhctp0ilmvTOpEP5dpXzMIIVQgViLQDdWlY8JoB7H0kiez-VEpjd6CHu9LMkAazdJGmt6O_Xc2ZANQ?key=ih94EB8R9t3SsAOHwe9Pnw

 

Give your Custom Action a clear description 👇

 

AD_4nXci1qDVhL4nSjvhPzbMmvlr_QnYFfGKIJrqhavpCYejiHmKP4BvI9h9BNJIDNrAPkRf60u3jCV6XadHQNPKMqY3NYZfx7_n9C4pPu0K2uynEYA8Q6NJtd02KaHz-uo6mzXRPqKIzlNCtFVbGf8onUwTKYM?key=ih94EB8R9t3SsAOHwe9Pnw

 

Configure the Request details: This is where you’ll need to enter the API URL to the 3rd party system you’re connecting to.

 

AD_4nXeEwAxd2ZO7ccRAeigpY_AMTk5SjzTygQ--Ceii8MuBT1X1AX3Yukg1s7QLuWIzo2i41AQPzD2FNOg9N7WqXj65aCdAgfMG8ob-Vm2gqpWahuv4OuGvlyFwlmsj8KbwKnaOzqpEdEPD7FYXGjXSG0RBFCIi?key=ih94EB8R9t3SsAOHwe9Pnw

 

Mine is a simple GET request to my API endpoint. Once done, you can click on the Next button. 

 

This is where we test the request that we have just configured to make sure it all works 👇Click on the Test request button

 

AD_4nXd275nxMeyjQ8znOwH6ulrEydfeZ_gp5lsrvcrVmFIg4h24FIIMseCTZIrDBK3mIS7GarpaA7SQZv6eWKsYe6d1WhF8Uf5qCzeucMqrxF2salaIqaCppufb5jrpOYv2atlr-UaONZHvnnoYTcYZ_HgbepXS?key=ih94EB8R9t3SsAOHwe9Pnw


 

We get a 200 OK response with the data from the API, looks like we’re ready to go!

AD_4nXc8PogPbYxA2iz-eSmcDlF2SmCvRoSgQEPcpB_bV1V8fwgs7mmHjPlVp6lvJRxIl8ZwkKd0sG-QDoP79sjS8i6-WLV--zg1zsoWOO_5VFyEIAcEYjvnr_Vg2a3OdXWXnHDnrcwu4pKKlzfxrH3pkpP5IbNZ?key=ih94EB8R9t3SsAOHwe9Pnw

 

Click on the Next button again and this is the important bit, the Response mapping, this step is optional but it’s important if you want to use the data in your Workflows, particularly for GET requests. It tells the action where to store this information in Intercom so that it can be given to customers in your Workflows as answers to their questions.

 

AD_4nXcJ2HszmE6wAX809wzDuq9iwEF_6UUN3FBOsklveqbrPO3aeWfkjRY0EGXvHg2Dnvj_Pq1xprzJ0pM5y4aoAiJVmr9UPpoMzWIRz6NjOrEtrtaMkIQtjsaoSJhrihelBAjHNsybEvJvEOK9KiCHQhLI8ZR2?key=ih94EB8R9t3SsAOHwe9Pnw

 

Now we map the response data to a Custom Object data - what is that? 

 

Custom Objects allow you to extend Intercom's standard People and Conversation object data to store data that represents your business in a more flexible way.

 

First step is to save our Custom Action and then Create a Custom Object data

To get started, go to Settings > workspace data > Custom object data.

AD_4nXff5gLUypBHyLZcUZjVC7XnBWYwk9ghIW4_m10Aqn-OfNI3E1KbeFkpZnRn3LxNNdlmCJJhVO0HLd0gwpCUh4PxgGgMz8S-kWo2X-luDKQR7pfFSZNQFqIoQ_DHdMVv_JwSq411TtuYkdZkKgdvAh72I7ih?key=ih94EB8R9t3SsAOHwe9Pnw

Create your first Custom Object by clicking on “Create new object”. Give the object a name (e.g. Boots CO to represent Boots Custom Objects since that’s what my fictional store sells) and then click “Save”.

 

AD_4nXcRV5h1nimlCTG_nVEYVOFmD5GwyXHji1CV-J1MSynUV88Nz_WIuCE-GLdaTpYw3mchXZi_V0IjiQQzsrpDN4q87TgSxtPoXt12Cu0dkxpZWrp-OOJK3oPCWlgS27eV1c1Is4hfOb0el-jN1rCxPAYJ0m8?key=ih94EB8R9t3SsAOHwe9Pnw

 

This creates a new parent object with some recommended default attributes that track some data that are important when using Custom Actions:

  • ‘external_id’
  • ‘external_created_at’
  • ‘external_updated_at’


 

Once done, we can create attributes that match up to the response of the API. I’ll not include ID since the external_id comes as a default attribute.

 

Next we add all of our attributes and map them to the response that correlates, then include a reference to Conversations which will allow us to create connections between our Custom Object and the conversation to power the workflow 👇

 

 AD_4nXdcWjUYYc-o00LAJnfrPQd3waxA7jw2ZGq7cffn6M736jXIGJ6rDa4_ot9YHvrZekhq_JqMOIEvJZjgAZteRXEwthu45U-VP1UyzFqGNFxQA-hNHyaDNu4w1GD-vs35k16Z7bS94fTB7pZ3xj2xlrkJgbqZ?key=ih94EB8R9t3SsAOHwe9Pnw

 

I also toggled the option to “Allow referencing multiple Conversations” - we talk about this in our article on Setting up references with Custom Objects. The gist of it is that multiple Conversations can happen about different Boots.  Here’s what the finished Custom Object data looks like 👇

 

AD_4nXcKLbnUlF2tTJhbGWjNt45MwzCx9RmIDbeN5s_B70Fynt-v5ldCczm3_auQWbWTRfVKMXrCGmYzhX1NVWsHIPJUcSyn8kifmc06BMYWkAkSjTSMyaRbo6PAAX-3Pka1RBxRsGdlR3AjG_wsadZ2dZPBM5Kl?key=ih94EB8R9t3SsAOHwe9Pnw


 

What we’ll do next is create conversation data where we want to store the boots we’re showing them and the one the customer is deciding to chat about.

 

First we’ll create Conversation data with the format Reference and select the Boots CO Custom Object  for the whole inventory that we’re showing, we’ll also toggle the “Allow referencing multiple Boots CO”. This is because this is a many - to - many relationship. 👇

AD_4nXfcTgXNk21GTzUUUnuF505aQToTzt0qEwFKYcqPqiOVcLSI05z88HP4xEQ6yJsFio-BRRjQR1X1wxosG85RxSiKUiH1wJfKxgUU51DMdZmJ9FFKZ_FiDxeH8LbJ3BT85rmEeJg0kELwcaKFym1SoNzMlKrn?key=ih94EB8R9t3SsAOHwe9Pnw


 

Next, we’ll create another conversation attribute to hold the particular boot that they have decided to chat to us about in the same way we created the first one.  I’m naming this “Selected Boot”.
This time around the “Allow multiple referencing BO will be turned off since this is to highlight just one particular boot.  

AD_4nXfz9fvDrKCLJcajWT6PbcLZbQ8g3zSu6OwWjHqWyGKF0vtU2w_8zQ9yFoOUSutS_hzxNYljgRMMTxPO_SeWf-JwF-ZYGJJbDN3HMPtSJWzYk0QvOvIDCWimcX5QaN0G0ukPRxdyqq-WXua7lXq_tS-F-gU-?key=ih94EB8R9t3SsAOHwe9Pnw

 

Once done, we can go ahead and Save everything, then head on back to the Custom Action to finish the Response mapping.

 

First we map the Intercom Object of the “Boots CO” to the API object that’s returned, in this case it’s an Array of Products.

 

Then we match each attribute that we have created in the Custom Object to a matching attribute from the API response. Once done, we select the reference from either People or Conversations to the Boots CO.

 

Once completed, here’s what it should look like 👇

 

AD_4nXfbom1haqDPwdP3PBRYzURaCmmnNWmg_KH1X_JNBz07aL_KmacLRpqmrYbZ1L1uO-rPe_nbgBnDqmvvsHVz4F5XLwMG71zGqgIsO1wZgdNeDL_6nw4paBuPKqvHCRG5HhPWygnjkVsT8eE1ZZTCmXltliM?key=ih94EB8R9t3SsAOHwe9Pnw

 

That’s it, your very first Custom Action with Custom Object and conversation references. Next we build out the Automation (Workflow) where we can have this interact with customers.

 

Here’s what my workflow looks like and how to add the Custom Action 👇

 

AD_4nXeJ9x6A0LJPDIi1sohyyonMO6mIo0xcjJN8aE2aGxszUHmvYv4w0nH66qrdHh62_M3C0lL3vCK42jlX9KqgUQSZLYcTE3PaguURsfSkKYT256uZtu9x1zKtIskdDpOAyNZZawakPlz6BJLPPur-ZKP24U8k?key=ih94EB8R9t3SsAOHwe9Pnw

 

Click on Select the Custom Action and select Boots

 

AD_4nXdg1hNzcv8r9T0pMsbGb3EKy5Ew4MU06FCr9JZuNqtVHbBpMhblPflNNRESpYFYFQGFQROR--FQuzx8HCPI_0XJVybK8LeWfxrTc-fZ0DYlLyv2qdjJuIR7Hnkzx-veIZ7Iv0D4PERL3mkf_K2CbM4l9V0?key=ih94EB8R9t3SsAOHwe9Pnw

 

Once done, add the message for if the Custom Action fails and then  add the Buttons from Custom Objects as the next step under the Custom Action 👇

AD_4nXeVT_T7aXISfpvMN33H9Og54-nPtUwZ2b5kAPg_hjgfixr95gdFK0M_jmvryWvyXn4KOD5h6RuctjRbQpzOgTzQlABRQz3hhjuVcWiw4NT4FuycTOw1NDRNN_o8yNx01LQELqHC0rXV_Qc6yhPJUZt6yilE?key=ih94EB8R9t3SsAOHwe9Pnw

 

Click on Select data and you can configure the button that shows up 👇

 

AD_4nXdnUrvJVMyn2IowOPPhuTPn_tPGD-NkHQyQXCHMslwlYsk5e4huV3MRvrh8q3DB1GE1tS9WvlZ_O1_BBEfbVTmQl8M_spNq8UOrSbH7kHIGxNW4NBw5_bSr6nGNwawaN5GxScPiRS3WCex9389Pbr_-CAky?key=ih94EB8R9t3SsAOHwe9Pnw

Click on Add condition to select the "Conversation > Boots data for Conversation from context” option 👇

AD_4nXdXVrZUOchb_Uf8fOZzo_ZvqPIEzV9PPgvYfIPpUM-GIj29PKM-eHxT-IRTwSz4XNFbzYipqByeYpG1UoJdQQkaCC_dJf4R5RlVis56RUIUKWTdDgd9PEEXvJxnyk3AAx-LY5esmhFKIFK23Lg6iQ8zCaY5?key=ih94EB8R9t3SsAOHwe9Pnw

We’re selecting this because this is where we mapped our data to in the configuration of the Custom Object and Conversation attribute.

 

Once done, you can select the number of buttons (boots in this case) that you want to show to the customer and what attribute the button should show 👇

 

AD_4nXfNTuzyeio24xRqg7OJwscj4cv0dS2mhkzgCqd4pa9flo869AN4FTBQFyUtIE5hbqf894-kxNJFq8HCCyn5SGNrxQn-5LdFqjr42hNziBWgqzpigqHijtaXUCApB9ambJU5VSgAxNNZpg-ZI27NgLZu1zZz?key=ih94EB8R9t3SsAOHwe9Pnw

 

Save and close that once you’ve selected your options, then enter None of the above (or if you have something else you want to link to, you can use this button to connect to another path).

 

Click on Save selection to and then click on the Selected Boot conversation data (remember, we named the other conversation data this to track the particular boot the customer wanted to chat about.) 

 

 AD_4nXfaPWkDhp7J5PXEt6Ite3MIJBAZaHSbihmd7DXKJxmwfkmGyROEPypgB9-I4nCnYBZxK5OvCaRGfKPSfz68ztouYsQPdAz8IQm9Z9JlmBlXPTmWpYp0XP_geOUp9qRNqHCzILUTtxEf5CarCU_ZbAVdpAWh?key=ih94EB8R9t3SsAOHwe9Pnw

 

I connected the buttons to other paths to get the data. You can click on the {..} to select the attributes and the scroll down the list until you get the Conversation > Selected Boot (Boot CO) options and structure the message however you want it 👇


 

AD_4nXchn5HWYowRVoMfmaHyUK29qCfDMLvFHK_LFZY57lyJoUgC7a_aDda305wd7SJ8BKEN2cqr0mplvYTOpElZgm7yGXDGYkTyfQf7iuzgYgFTrNneZISKQLY3v1CLS9ulzWfsEwjACP2zUdTuUPu-mP9qGik?key=ih94EB8R9t3SsAOHwe9Pnw

AD_4nXdGlYVV-2a4FdMNTTF9OEFWmyuTZ7a2LrEmEk7z6D_VczJzhKa4b6n-zDz2ToQ0_oxu5C_y79EUtpvVEmzfNl950FibfXHV2n65KZ0jjBPO-5d3yw8Z61zJ5K6FufODP6RWkPG6XGIhfmfMYwFd28LbAXuS?key=ih94EB8R9t3SsAOHwe9Pnw

 

Completed Workflow 👇

 

AD_4nXe20XjAPQoeuPyxyU5qSkJwUtsXKHUJehVmdp2HI36IXUpu6ScnVj61Uz8dpqImCTRqyZ3xVVWyEmN3OHsWmrqaD-m7yescNzRSLOncHUm1fkn9azBCWwayQ_Nv2Hh-wlzSarcfj3WJbn-RAHzCNk5o2NA?key=ih94EB8R9t3SsAOHwe9Pnw


 

Here’s what a Preview conversation of the workflow looks like

 

AD_4nXcNNoVT2uSXDoCtzXbbDluQ1--Nl_XJj9SWUWgCChnYbdxl1ZhZcLchV5Yz0aD4RuhUDfbKSkLczPauQRlqsxqjnYZ0zLfQsEYs1PaPTT169cw39cVRb7RL2sQky7XJE9L0_FMZILrq0Qhgesj40fq9jttZ?key=ih94EB8R9t3SsAOHwe9PnwAD_4nXcjbRnQOxVACc6mGu-gaQZVXT4fcRPZFbOhqpF3U9juAqc2QYaWGjm5wrTFg6fBD09xl_1tlutAQ5e8Z-GM6WmYjkzPRYqxZ7NCMkfF1-t0ssYd6PSwWcvnRTs47uMnwnbSLz-paptWxahhJUqGBZU0ka2n?key=ih94EB8R9t3SsAOHwe9Pnw

 

You can see the details saved to the conversation attributes, both for the Boots data and for the Selected boot

 

AD_4nXd0yRt7rssIS_RgyvD-HsdAFEWwYsKy4eT8rEKdWF--dhuEOsYbdkSRSQzjlYn05fC8evEp8--b_1XsGqjPj0aHGHyuXz8ysjT89iXVamBFtCKavMad5qbF1g5Kz7kEDYs3uAschKwCxivx6SToGpUcj8Ys?key=ih94EB8R9t3SsAOHwe9Pnw

 

Selected Boot 👇
 

AD_4nXc765QhDv3Abaua9XRoo-CF8aLUfeWj8KrRTwC1NCBEB_E5uyoHD_A6NVJHo_PEy53hgh5VfMWT3Hg7h6Yf7uBmXH3bclus2_iVuqBqC-u7T0pMcDNUPVsLaBZoVqTNo_8dLMQazPtpOc_MW0CynKHU3PYX?key=ih94EB8R9t3SsAOHwe9Pnw

 


0 replies

Be the first to reply!

Reply