Re: Tokens to populate Q&A in Forms

Anonymous
Not applicable

Tokens to populate Q&A in Forms

HI has anyone used tokens in forms ?

Trying to figure out a way where in the form if i ask Question 1. What is your car ? Ans : Mazda.
Both the question and answers are concatenated.

These field may not be able to sync to SFDC but sits in marketo as temp fields.

Please advice if anyone has done anything similar.
Tags (1)
8 REPLIES 8
SanfordWhiteman
Level 10 - Community Moderator

Re: Tokens to populate Q&A in Forms

It would be simple to concatenate field name and field value using the onSubmit event of the Forms API. Don't see what this to do with tokens, though.
SanfordWhiteman
Level 10 - Community Moderator

Re: Tokens to populate Q&A in Forms

Demo here of a simple way to reuse the same fields with different names, prepending the name to the value upon submit.

I'm not exactly clear on your use for this.  You have to be really sure the same person is never asked the same question with a different dynamic name.
Anonymous
Not applicable

Re: Tokens to populate Q&A in Forms

Hi Bamah,

I am assuming that you are using a separate field for your question. If so then you can simply create a trigger that will fire on form submission and in flow you can update the question filed with a change data value action flow in following way:

0EM50000000T9t2.png

You can concatinate any string with a token in change flow action. Hope this will work.

Thanks,
Amit
SanfordWhiteman
Level 10 - Community Moderator

Re: Tokens to populate Q&A in Forms

@Anurag Well yeah... but then you need to customize a trigger for every possible field name.  This is a lot easier to do on the browser side.

I also don't see in general @Bamah would need to "relabel" the field values if the field name is always the same for all her users.  That's not how databases are supposed to be used: if the field name is always the same -- and you obviously can always view the field name in the interface -- why would you need to prepend anything to the value?
Anonymous
Not applicable

Re: Tokens to populate Q&A in Forms

Hi Amit

I am looking at the exact way you have mentioned about the tokens populating.

So here is the scenario :
I have a temp field that I am going to use to populate a question, (which is not sync to SFDC). e,g, What colour is your car ? The answer that is captured, how can I place that as a token so that I am able to concatenate those Q&A of say 3-5 temp fields and write them into a field that is synced in SFDC.

Please advice
 

Thanks
Bamah
 

SanfordWhiteman
Level 10 - Community Moderator

Re: Tokens to populate Q&A in Forms

@Bamah P There's no such thing, really, as a "temp field" on the server side.  There are fields that aren't synced to SFDC -- maybe that's what you mean -- but you can't post data to a field that gets saved on the Lead without that field existing, as a permanent custom field, in your Marketo database.

If you're talking about form fields purposely called generic names like "Question 1" and "Question 2" you can create them all on the browser side -- where they are truly "temporary" as the server doesn't know about them -- and then save all the data to the one, single field you want to hold this data on the server. 

IMO anything else you try to do with triggers and tokens and so on is going to be a management nightmare.
SanfordWhiteman
Level 10 - Community Moderator

Re: Tokens to populate Q&A in Forms

Demo of writing an unlimited # of temporary, browser-only fields into a single Marketo field as a concatenated value.

Using this method you could maintain only one field in your Mkto database to hold a wide variety of interesting form info.

In the demo, the permanent field (FirstName) is still shown on the form, but obviously in production you'd actually want that to be a hidden field, with the user only seeing the temporary fields (car, movie, animal)
Justin_Norris1
Level 10 - Champion Alumni

Re: Tokens to populate Q&A in Forms

Amit, I think I understand your use case. If you have 3 or 4 Marketo only fields and you want to concatenate them into a notes field or something similar in SFDC. 

You could do this pretty much via the method Anurag supplied: have a trigger after form submit that does a Change Data Value on the SFDC field and brings in whatever text and tokens you want. You can then write your Q&A and merge in the tokens as desired in the notes field. 

That being said, I agree with Sanford about the general unwieldiness of this approach. Sanford has given you a pretty sweet alternative that does NOT involve cluttering up your DB with single-use fields. Nice!