Skip to main content
Question

I want to find matching responses from two API calls and return them to Slack

  • 18 August 2024
  • 1 reply
  • 12 views

I am stuck trying to make a zap with a few API calls. I’m relatively new to this. 

My use case:
Users being able to enter a product code in a slack channel and zapier queries a workflow tool and returns information and status about that product. The workflow tool does not have a native integration. 
 

My setup: 
1. Trigger - a user enters a message in a slack channel (this is a product code). 
2. Action - GET pulls a list of jobs, filtered by JobName. It looks like this: 


    {
      "clientId": "ea65f692-afcd-47d9-8606-ee915728f915",
      "jobId": "f0bf2cf9-ba22-4ced-bfa9-5958cd10031d",
      "jobCode": "Q3 2024 // Apparel",
      "jobName": "New Ecomm Apparel",
      "jobStatusId": 9000,
      "jobStatusName": "Done",
      "createdUtc": 1722441508000
    },
    {
      "clientId": "ea65f692-afcd-47d9-8606-ee915728f915",
      "jobId": "58a8e129-ce0c-4640-a098-00d47cefad6b",
      "jobCode": "August 2024 // Apparel",
      "jobName": "New Ecomm Apparel",
      "jobStatusId": 3000,
      "jobStatusName": "In Progress",
      "createdUtc": 1716931413000
    },

… and so on. This step works fine. 
 

3. Action - GET pulls a list of Products using the product code from Slack. This step works. 

 {
      "productId": "000d35bd-2ad7-42dc-bb8c-e129649207c7",
      "jobId": "58a8e129-ce0c-4640-a098-00d47cefad6b",
      "clientId": "ea65f692-afcd-47d9-8606-ee915728f915",
      "productCode": "2133696",
      "productName": "Daily Outing Cream Ribbed Short Sleeve Tee",
      "color": "RE10322: VANILLA",
   
    },
    {
      "productId": "2e305fd3-6e73-49c3-af9d-adab04766f33",
      "jobId": "f64ac5ab-6091-4ffc-83df-0c7d4a083d43",
      "clientId": "b5a093ac-f6ae-4018-9d8f-1d835a89771b",
      "productCode": "2133696",
      "productName": "Daily Outing Cream Ribbed Short Sleeve Tee",
      "color": "VANILLA",
     
    },
    {
      "productId": "ec26a60f-c8b1-41d9-bae1-be7130c8d947",
      "jobId": "a4c55520-07da-43da-94f9-774e659c3752",
      "clientId": "b5a093ac-f6ae-4018-9d8f-1d835a89771b",
      "productCode": "2133696",
      "productName": "Daily Outing Cream Ribbed Short Sleeve Tee",
      "color": "VANILLA",

     … and so on. 
 

This is where I’m stuck. 

I want to return information about PRODUCTS (Step 3) where their JobId is a match with one of the JobIds from Step 2. I highlighted an example of a match. 

I would want to be able to return the information to Slack. If there are more than one match, I’d like to return multiple items. 

What do I do from here? 

Hi @apay 

You’d likely have to use a custom Code step to apply that logic.

https://zapier.com/apps/code/help


Reply