Skip to main content
Best answer

Duplicated id for trigger ourput

  • August 4, 2022
  • 2 replies
  • 34 views

HI community,

In my system users can create their own fields and call it as they wish. The only restriction is using _ at the beginning because that’s how we represent the id of the data. Since every output trigger needs an id, I was just converting the _id to the id field, but this creates a conflict when a user has an id in their data. Like this:

{
_id: '123123',
id: '2'
}

My questions is if there is a good solution for solving this problem.

I was thinking about not using the _id for the output id but I wouldn’t use what to use instead.

Thank you! 

 

Best answer by Diego Orca

I fixed the issue encapsulating the data into an object like this:

{
id: '1',
data:{
id: 'example1',
name: 'example'
}
}

 

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

2 replies

GetUWired
Forum|alt.badge.img+12
  • Zapier Solution Partner
  • August 4, 2022

@Diego Orca 

Might not be the best solution but the simplest might be just to preserve the ‘id’ field to a new key prior to overwriting it with the ‘_id’ field?


  • Author
  • Beginner
  • Answer
  • August 9, 2022

I fixed the issue encapsulating the data into an object like this:

{
id: '1',
data:{
id: 'example1',
name: 'example'
}
}