0

Could you please provide any suggestion to build logic for below scenario??

Progress:

I have one data extension which has three columns:

  1. City
  2. Area
  3. Center.

I have created landing page which has the three picklist fields listed above.

in first picklist i have populated the distinct values from City

Challange:

First only city picklist is visible and the other two picklists should be disabled.

When the user selects any value from city picklist, then it should give call to marketing cloud server with selected city parameter before allowing the user to click the submit button.

The server will search the Area column of data extension, using passed City value and return the matched area values under particular city to new Picklist

I need help on two topics:

How this logic should be implemented - Meaning should call be made before clicking on submit button? Meaning when user select the value from picklist.

I haven't came across this server client scenario. I have seen some examples where RequestParameter() is used, but i don't exactly where should i write this logic. Should i create two landing page one for form and one two handle server logic?

Please explain with some steps

1 Answer 1

1

There are two routes to go with this:

Javascript:

  1. Using SSJS pull a JSON of your values from the DE
  2. Pass the JSON to the Client side - will need to Stringify.
  3. Using Javascript or JQuery, you will need to parse through the JSON and have the picklists activate/fill based on user actions. (sample from SO)

AMPScript: (Will require multiple LPS)

  1. Using LookupOrderedRows() or similar - pull the unique City values from your DE
  2. Use Row and Field to get specific values via a FOR loop.
  3. Fill in your picklist (potentially using BuildOptionList().
  4. Create a LP with AMPScript to display content based on passed parameters e.g. %%[IF @submitCity == 1 THEN]%% City Picklist content %%[ELSEIF @submitArea == 1 THEN]%% Area Picklist content %%[ELSEIF @submitCenter == 1 THEN]%% Center picklist content %%[ELSE]%% Default content %%[ENDIF]%%

  5. Have the LP post to itself using a hidden field on each dynamic area to show the iteration - e.g. <input type="hidden" name="submitCenter" value="1" />.

  6. Using RequestParameter() to collect the values posted and use those to do a lookup to fill in the next picklist from the previous response.

I personally recommend the Javascript solution as although it is difficult for those not familiar with JS, it will not require 3+ page impressions for each form filled out. It also is a bit less complex and will likely require less maintenance.

6
  • Thanks for your help.. I am working on the second (AMP Script solution) but I would like to prefer first one because i already worked on JS. Could you please provide any sample code or any link which would help me?
    – Puja
    Sep 18, 2017 at 13:29
  • The sample from my answer (stackoverflow.com/questions/14453677/…) should help with the javascript portion Sep 18, 2017 at 14:44
  • Thanks!!.... I have used jquery in visualforce pages but not in marketing cloud. First I need to download jquery zip file and upload in portfolio. Right?? Could you please help me with some starting points?? I will do the rest..
    – Puja
    Sep 19, 2017 at 8:12
  • You can use cdn or store in portfolio for jquery. Outside that it is same as normal webpage or VF page Sep 19, 2017 at 10:28
  • @ Gortonington Thanks.... !! I am able to use Jquery. As per your suggestion I have retrieved data from DE using SSJS. Now I want to pass it to client side. I don't know how to do this. Could you please suggest?? just give any useful link
    – Puja
    Sep 19, 2017 at 10:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .