1

In ExactTarget, can we pass a Personalization String in Javascript Function?

So I Have function as below. e.g.

var DE = DataExtension.Init(DataExtension);

I have dynamic variable for the name of "DataExtension" which I get from the URL Say:

var DynamicDataExtension = Variable.GetValue("@DataExtension");

Now I can use the

var DE = DataExtension.Init(DynamicDataExtension);

instead of

var DE = DataExtension.Init(DataExtension);

ExactTarget: Data Extensions and Data Relationships

2
  • What is it that you're asking for here? What is the problem? Where are you stuck? Commented Dec 5, 2014 at 2:01
  • @Mark..I want use the dynamic value of data extension in the DataExtension.Init(DataExtension); function. I am passing the value through URL so the data extension name will be different each time. I have tired this but this does not served my purpose. var DE = Variable.GetValue("@data"); var DnamicDE = DataExtension.Init(DE); Commented Dec 5, 2014 at 15:59

1 Answer 1

1

Yes. Following your code, you would just set it to an AMPscript variable beforehand.

Like

%%[
SET @first_name = first_name /* here is your personalization string */
]%%

<script runat="server" language="javascript" >
    Platform.Load("Core","1");
    var firstname = Variable.GetValue("@first_name");
 //etc.
 </script>

etc.

3
  • You're welcome. If it works, please mark this as answered. Commented Dec 5, 2014 at 16:12
  • Thanks @Timothy... So my question was I can use something like below.. %%[ SET @first_name = first_name ]%% <script runat="server" language="javascript" > Platform.Load("Core","1"); var firstname = Variable.GetValue("@first_name"); var DnamicDE = DataExtension.Init(firstname ); </script> Commented Dec 5, 2014 at 16:39
  • 1
    Yes, I have done that very thing. Commented Dec 5, 2014 at 16:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.