Question

Data structure mismatch

  • 25 January 2023
  • 3 replies
  • 66 views

Hello!
I have a trouble with pretty easy zap: Intercom trigger - Hubspot ticket.
I have found that trigger for Intercom event “Tag added to conversation” load a tag, but data structure of that tag is different from data that I receiving in live mode(“Data out” from Intercom) and that’s a reason why I cannot assign a values that I need to create ticket in Hubspot(because structures mismatched, fields that I assign to Hubspot ticket are dont exists and I cannot assign real fields because Zapier doesn’t allow me to do it). How can I change Intercom data structure to match with real structure?

Tag data structure:

id: 1
created_at: 2023-01-25T10:36:14.000Z
updated_at: 2023-01-25T11:47:21.000Z
waiting_since: 2023-01-25T10:36:15.000Z
snoozed_until: null
open: true
state: open
read: true
tags:
type: tag.list
tags:
1:
type: tag
id: 1
name: EXAMPLE TAG NAME
applied_at: 1
applied_by:
type: admin
id: 1
assignee:
type: nobody_admin
id: null
conversation_message:
type: conversation
id: 1
subject:
body: <p>This is a test message</p>
author:
type: user
id: 1
name: Nikita R
email: nikita.r@example.com
attachments:
url: https://example.com/
user:
type: user
id: 1
tags_added: EXAMPLE TAG NAME

Actual data structure(“Data out” from Intercom):
 

type:	conversation
id: 1
created_at: 2023-01-25T16:45:08.000Z
updated_at: 2023-01-25T16:46:48.000Z
user:
type: user
id: 1
user_id: 1
name: example
email: example@example.com
do_not_track: null
assignee:
type: admin
id: 1
name: Assignee
email: assignee@example.com
admin_assignee_id: 1
team_assignee_id: 1
conversation_message:
type: conversation_message
id: 1
url: https://example.com/
subject:
body: <p>Hello! example message!</p>
author:
type: user
id: 63d15c37df7b3110c7be3eed
attachments:
conversation_parts:
1:
type: conversation_part
id: 1
part_type: comment
body: <p>Hello! example message!</p>
created_at: 2023-01-25T16:45:07.000Z
updated_at: 2023-01-25T16:45:07.000Z
notified_at: 2023-01-25T16:45:07.000Z
assigned_to:
author:
type: user
id: 1
name: example
email: example@example.com
attachments:
external_id:
open: true
state: open
read: false
tags: EXAMPLE TAG
custom_attributes:
Conversation Language: English
User Type: Searcher
links:
conversation_web: https://app.intercom.com/a/apps/1/conversations/2
body: <p>Hello! Example message</p>
link: https://app.intercom.com/a/apps/1/conversations/2
conversation_id: 1
author_id: 1
user_id: 1
Fields with no value:
conversation_rating
snoozed_until
metadata
tags_added
subject

As you can see, there is a huge difference between this structures and I want to know how can I user the real data struct to make my Zap work as expected?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +14

Hi @Nikita R 

Good question.

You can manually create a variable using this approach…

In the Zap step, map a variable.

Then copy/paste that variable into a web browser search bar. that will expose something like this:

{{1234567890__records__fields__Email}}

NOTES:

  1. The ID at the start is the ID from the Zap Step
  2. Double underscores indicate nesting data structures

 

If you know the desired structure, then you can adjust to then copy/paste the variable back into the Zap step.

Make sure to test again live and check your Zap Runs to see the DATA IN/OUT for each Zap step.

Hi @Nikita R 

Good question.

You can manually create a variable using this approach…

In the Zap step, map a variable.

Then copy/paste that variable into a web browser search bar. that will expose something like this:

{{1234567890__records__fields__Email}}

NOTES:

  1. The ID at the start is the ID from the Zap Step
  2. Double underscores indicate nesting data structures

 

If you know the desired structure, then you can adjust to then copy/paste the variable back into the Zap step.

Make sure to test again live and check your Zap Runs to see the DATA IN/OUT for each Zap step.

Thank you for the answer! This method works, but only for the first layer of nested data structure. For example:
 

{
...
id: 1
conversation_parts:
1:
type: conversation_part
id: 1
part_type: comment
body: <p>Hello! example message!</p>
created_at: 2023-01-25T16:45:07.000Z
updated_at: 2023-01-25T16:45:07.000Z
notified_at: 2023-01-25T16:45:07.000Z
assigned_to:
author:
type: user
id: 1
name: example
email: example@example.com
attachments:
1:
type: upload
name: Screenshot
url: http://url.com
content_type: image/png
filesize: 1
width: 1
height: 1
2:
type: upload
name: Screenshot
url: http://url.com
content_type: image/png
filesize: 1
width: 1
height: 1
...
}

And tags like {{%zap_step_id%__id}} works great, but for nested element’s not great at all.

I’m trying to retrieve an attachment URL from this structure with following tag:
{{%zap_step_id%__conversation_parts__1__attachments__%attachment_element_id%__url}} but it cannot find the data no matter how I tried to change the tag, example of how I tried:
1) {{%zap_step_id%__conversation_parts__attachments__%attachment_element_id%__url}}
2) {{%zap_step_id%__conversation_parts__1__attachments__url}}

3) {{%zap_step_id%__conversation_parts__attachments__url}}
So I think the initial tag is correct, but there is definitely a reason why I cannot retrieve a data, but I cannot see it. Can you help me with that?

Userlevel 7
Badge +14

@Nikita R 

Mike be best to open a ticket with Zapier Support for further assistance with this: https://zapier.com/app/get-help