SOLVED

Can I store code somewhere and call it in Marketo?

Go to solution
Troy_Larson
Level 4

Can I store code somewhere and call it in Marketo?

Hi everyone, 

 

I have a question for you all. So I have a promotion where we want only 1 person from a domain to receive a coupon code. So for example, person1@ABC.com fills out a form and gets their coupon. Then person 2 from @ABC.com attempts to fill out the same for for the same offer. What I'm trying to do is to block person 2 from @ABC.com from receiving the offer because Person1 already claimed it. 

 

The idea I had was to create some custom code that took the email domain and put it on a list, then checked that list for each subsequent form submission to see if that email domain was already on said list. The challenge I'm having is that my developer team does not want to store this information outside Marketo. 

 

So - does anyone know if there is a way to store this in Marketo and call this code to process when each person fills out a form?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Can I store code somewhere and call it in Marketo?

Well, at the risk of being overly precise, the code must execute outside Marketo but need not be stored permanently outside Marketo. That is, you pass your logic to an external task runner which doesn't save anything, just runs and exits.

 

However the data must be stored outside Marketo, because that's how the different webhook executions can access the db of the already-used domains.

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Can I store code somewhere and call it in Marketo?

Is your Developer team concerned about security or just annoyance?  The data doesn't sound super-sensitive.

 

In any case, you can't do this kind of cross-lead coordination thing without using a webhook, and we do it 10s of thousands of times a day across lots of instances. 

Troy_Larson
Level 4

Re: Can I store code somewhere and call it in Marketo?

Hey @SanfordWhiteman thanks for the assist again! And basically to use a webhook the actual code lives outside Marketo - do I have that right?

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I store code somewhere and call it in Marketo?

Well, at the risk of being overly precise, the code must execute outside Marketo but need not be stored permanently outside Marketo. That is, you pass your logic to an external task runner which doesn't save anything, just runs and exits.

 

However the data must be stored outside Marketo, because that's how the different webhook executions can access the db of the already-used domains.

Troy_Larson
Level 4

Re: Can I store code somewhere and call it in Marketo?

Hey @SanfordWhiteman - Had a quick follow up to our thread here. Do you know if it's possible to have an API write to a static list?

 

For example, I was thinking that I could do it manually by updating the "Not Contains" field (see screenshot). I was wondering though if I could automate this? If so, how? Any ideas? As always the help here is appreciated. 

 

Troy_Larson_0-1582139571378.png

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I store code somewhere and call it in Marketo?

A webhook response can't directly add someone to a static List, but it can certain trigger them being added to a List (by using the Webhook is Called trigger with a string match on the response, for example.

 

How would a List help you here, though?

Troy_Larson
Level 4

Re: Can I store code somewhere and call it in Marketo?

The idea is to use that "Not Contains" value to filter people out who may fill out our form. I manually receive a list from a peer here of people to block (so it grows each week).

 

Now, ideally I'd like to automatically update that domain list. That's why I was asking if I could get a webhook to write to that "Not Contains" value. Does that make sense? Is that possible?