Best answer

Custom Webhook not populating previous steps data correctly

  • 2 November 2023
  • 5 replies
  • 104 views

Userlevel 1

I have a webhook getting data from Authorize.net, which I am then passing to HubSpot via a Custom Request step. 

Everything works dandy when I plug in regular data to the Custom Request, but when referencing data from a previous step it appears that Zapier isn’t entering the actual data in the JSON body, but the reference code it’s self. 

This is the error I am getting: 
Property values were not valid: 

[{"isValid":false,"message":"{{_GEN_1698857914648__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}getTransactionDetailsResponse__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transaction__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transId}} was not a valid number. Numbers cannot contain commas or multiple periods.","error":"INVALID_INTEGER","name":"transaction_id","localizedErrorMessage":"{{_GEN_1698857914648__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}getTransactionDetailsResponse__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transaction__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transId}} was not a valid number. Numbers cannot contain commas or multiple periods."},{"isValid":false,"message":"{{_GEN_1698857914648__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}getTransactionDetailsResponse__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transaction__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}settleAmount}} was not a valid number. Numbers cannot contain commas or multiple periods.","error":"INVALID_INTEGER","name":"amount","localizedErrorMessage":"{{_GEN_1698857914648__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}getTransactionDetailsResponse__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transaction__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}settleAmount}} was not a valid number. Numbers cannot contain commas or multiple periods."}] (HTTP Status Code: 400)

This clearly shows it is passing

{{_GEN_1698857914648__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}getTransactionDetailsResponse__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transaction__{AnetApi/xml/v1/schema/AnetApiSchema.xsd}transId}}

instead of just 

80007666990

Anyone ever had any issues like this before?

icon

Best answer by Troy Tessalone 2 November 2023, 18:03

View original

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

5 replies

Userlevel 7
Badge +14

HI @nickgurney 

Good question.

Can you post screenshots with how the data is being returned from the Zap trigger step? (DATA OUT)

 

Userlevel 1

HI @nickgurney 

Good question.

Can you post screenshots with how the data is being returned from the Zap trigger step? (DATA OUT)

I actually have an intermediate step where I call the Authorize.net API, that is the data I am trying to use. 
1. Get Webhook when transaction occurs
2. Call Authorize.net API to get additional transaction information
3. Call HubSpot API to populate data

 

Userlevel 7
Badge +14

Hi @nickgurney 

You may have to try using this Zap trigger: Webhook - Catch Raw Hook.

Then use a Code step to parse the JSON.

 

Here’s the likely issue...

Using an example:

 

The variable names have curly brackets {}.

 

Zapier uses the double bracket syntax for variables:

{{variable}}

 

So the issue is when you include the Authorize.net variable syntax, Zapier interprets the inner brackets and converts it.

{{{variable}}}

 

Then when the Zap action step runs, no value is passed, because the mapped variable is invalid.

This breaks the mapped variables values from deriving the actual variable value to be used in the HubSpot API request.

 

Related topic where I’ve explained this concept:

 

Userlevel 1

@Troy Tessalone 

Okay this is really helpful. I can’t just use a raw hook because I am just making an API call and it’s formatting it for me in response. I guess I’ll have to use a code step to call the API and then map the fields to more friendly references

Userlevel 7
Badge +14

@nickgurney 

Yeah try a Code step.

Ask ChatGPT if you need help with the code.