1

I am doing the following code in ExactTarget landing page:

%%[ 
VAR @Rows,@email,@rowCount
SET @Trigger = QUERYPARAMETER("Trigger")
]%%

<script runat="server">  Platform.Load("core", "1");
var DE =  Variable.GetValue("@Trigger");
var NewDE = DataExtension.Init(DE);
var filter = {
    Property: "EmailAddress",
    SimpleOperator: "equals",
    Value: "[email protected]"
};
var data = NewDE.Rows.Retrieve(filter);
if (data.length > 0) {
    Write("<table border='1' cellpadding='2' cellspacing='3' style='border-collapse:collapse;>");
    for (var i = 0; i <= data.length; i++) {
        var d = data[i];
        Write("<tr>");
        for (var key in d) {
            Write("<td>" + d[key] + "</td>");
        }
        Write("</tr>");
    }
    Write("</table>");} </script>

The URL from which I am grabbing value is like.. http://pages.e.mycompanyname.com/Result/?Trigger=abandon_cart24hr

I want to show the data extension rows based on selection from form on first landing page. This is the code on second landing page. I grabbed the value from url and passing it to JavaScript. But this does not show me any results. Am i missing something.?

5
  • Please post at least the interesting parts of your URL as well.
    – Timothy
    Dec 5, 2014 at 21:56
  • @Timothy..I added the url above...I am just passing a simple parameter from a Form on first landing page.
    – CodeDiva
    Dec 5, 2014 at 22:44
  • Please add %%=v(@Trigger)=%% between your two blocks and verify on your landing page that you see a value for trigger. Also, your script tage needs to say <script runat="server" language="javascript" >
    – Timothy
    Dec 5, 2014 at 22:54
  • Thanks @Timothy..I made the changes and also verified the value for trigger n my page. I figured out the line var data = NewDE.Rows.Retrieve(filter); is having some issue. As until before that line everything is working fine.
    – CodeDiva
    Dec 5, 2014 at 23:18
  • You're still missing the single quote in the table tag. Dec 6, 2014 at 16:02

1 Answer 1

0

I'd recommend using the Write() function to debug your inputs. For this URL, http://pages.companyname.com/test1?trigger=BirthdayDE&[email protected], here are the results that I got.

%%[
SET @Trigger = QUERYPARAMETER("trigger")
SET @email = QUERYPARAMETER("email")
]%%
<script runat="server">
    Platform.Load("core", "1");
    var trigger =  Variable.GetValue("@trigger");
    var email =  Variable.GetValue("@email");
    var DE = DataExtension.Init(trigger);
    var filter = {
        Property: "EmailAddress",
        SimpleOperator: "equals",
        /* Value: "[email protected]" */
        Value: email
    };
    var data = DE.Rows.Retrieve(filter);
    Write("<br>trigger: " + trigger);
    Write("<br>data.length: " + data.length);

    if (data.length > 0) {

        Write("<table border='1' cellpadding='2' cellspacing='3' style='border-collapse:collapse;'>");
        for (var i = 0; i <= data.length; i++) {

            var d = data[i];
            Write("<tr>");
            for (var i in d) {
                Write("<td>" + d[i] + "</td>");
            }
            Write("</tr>");
        }
        Write("</table>");
    }
</script>

page results

0

You must log in to answer this question.

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