Sum two score fields into another score field with Webhook | Community
Skip to main content
Itay_Billet4
Level 8
January 14, 2025
Solved

Sum two score fields into another score field with Webhook

  • January 14, 2025
  • 1 reply
  • 1197 views

Hi all, we wanted to setup a webhook to calculate the sum of 2 fields (Behavior Score and Demographic Score) and update to another field called "Person Score".

We created the webhook and the php code (attached both), and we're getting Response Code: 200, but the actual "Person score" is not updated. 

Can you check what might be the issue? 

 

Many thanks

 

Itay

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

This isn't really the place to troubleshoot code running on a totally different server. The design of that PHP code is totally wrong, though: you don't need to (and certainly shouldn't) use the REST API to update. You send the summed field in the response and Marketo writes it to the person record.

Anyway, I think you still have a FlowBoost subscription. Why not use that? It's one and done:

sum = {{lead.field1:default=0}} + {{lead.field2:default=0}}

 

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
January 14, 2025

This isn't really the place to troubleshoot code running on a totally different server. The design of that PHP code is totally wrong, though: you don't need to (and certainly shouldn't) use the REST API to update. You send the summed field in the response and Marketo writes it to the person record.

Anyway, I think you still have a FlowBoost subscription. Why not use that? It's one and done:

sum = {{lead.field1:default=0}} + {{lead.field2:default=0}}

 

Itay_Billet4
Level 8
January 15, 2025

Thanks @sanfordwhiteman! What happens if we need more than 50,000 invocations per month? do we get an alert?

 

SanfordWhiteman
Level 10
January 15, 2025

Just use Send Alert! Set up a trigger campaign like this:

(And have all your FlowBoost ‘hook names start with a common string, like “FlowBoost » Add Scores”, “FlowBoost » Cap Registrants”, etc.)