Chris Crocco
We are wanting to create response options that route an event to a particular team based on the response chosen.
I'm guessing that this can be done via outbound integration tying the response identifier to a specific group, but generating a duplicate event via the transform script is where we are running into issues.
If anyone has ever done this before, or has a better understanding of how to do a duplication via the integration builder we'd appreciate some insight.
0
Comments
Please sign in to leave a comment.
Hey Chris,
I'm working on putting something together that will help show off this kind of thing. But to get you started, here are some pointers:
1. The response value can be accessed with "callback.response". This is the text value in the Response column on the Responses section of the form. This is human readable for easy access.
2. You can reference properties of the "parent" event using "callback.eventProperties.propertyName". If your property name has spaces or special characters, you can use "callback.eventProperties[ "My Funky's property" ]". Just note that the eventProperties is hard to work with by itself, but every new script in the builder has a section for looping through and updating this to be easy to work with. Check out the scriptlet at the bottom of this post.
3. You just make a web service call like any other and target the Form endpoint url. Just copy the path portion and paste it into the path value of the http request object.
You can use this scriptlet to get you started:
This is the section of code you'll need to deal with the ugly nature of the eventProperties. Fortunately, this gets copied into newly created scripts, but I include it here for reference:
With this code in place, you can reference the properties like this:
Instead of needing to loop through the entire eventProperties array and checking the name just to get the value. Not pretty.
I hope that helps.
Let me know if you have more questions!
Happy Monday!
--- Travis
Ha. I knew it was a good idea to write this up... So much so that I apparently did it already!
GIG: Follow up notification based on response with bonus QR codes!
I had to make a couple updates to reflect some UI changes, but the rest of it is good info.
Thanks Travis, I appreciate you pointing us in the right direction