Questions tagged [ssjs]

Server-side JavaScript (SSJS) in the Salesforce Marketing Cloud allows a developer to use JavaScript syntax and proprietary platform libraries for server-side processing.

Filter by
Sorted by
Tagged with
1
vote
1answer
365 views

Filter DE via SSJS an store Data in AMPScript

In my Cloudpage i use SSJS to filter a special row of my Data Exention. email = Request.GetFormField("email"); hash = Request.GetFormField("hash"); accountDE = DataExtension.Init("...
1
vote
1answer
136 views

Automated way to move emails between folders?

under Email Studio -> Content Menu item -> My Emails folder, we keep our sent emails in various subfolders (say A, B, C, D). We'd like an automated method of moving emails older than 7 days in each ...
0
votes
1answer
523 views

Error when running do/while continuerequest for SSJS API

I need to pull a comprehensive unsub list and automate this process daily, and unfortunately the data view _Subscribers only goes back 6 months so a query is out. The best solution I have found to ...
4
votes
2answers
1k views

Looping through json in email - impossible?

This nested Guide Template Language snippet brings me 6 rows of titles. Problem: I have a complex layout in an email and I want to populate it with titles in different places. I can not make a ...
0
votes
1answer
33 views

Spilt one email into multiple jobids

So I have a weekly email, that has some conditional content based on the subscriber. Instead of making 5 different emails, I've done some Ampscript to split out the content based on the subscriber. ...
1
vote
1answer
1k views

SSJS extension function call to append variable

I have one line in my could that's giving me a 500 internal err and it's my append to the dropdown list. I've tried $('#test').append(fillDataList(obj)); and jQuery('#test').append(fillDataList(obj));...
1
vote
1answer
166 views

AMPScript - Create and Store couple of records to access them in SSJS

I have some AMPScript writing records to a data extension. Using AMPScript I would like to store those records in a variable to access them in a javaScript function. What is the best way to do it ? &...
0
votes
1answer
746 views

DE manipulation in Automation Studio

I'm trying to write a SSJS script in Automation Studio. I want to retrieve column values from one DE, clear that table, and write that column data to another one. (Among other things.) In a prior step,...
0
votes
1answer
407 views

Detecting if a custom content block is empty using AMPscript or SSJS?

Does anyone know if there's a way to evaluate whether a custom content block is empty or not using ampscript or SSJS? For example, if there's a way to detect whether <custom type="content" name="...
1
vote
1answer
817 views

Accessing Substitution Strings with SSJS in Automation Studio

I'm trying to drop a file into a particular FTP folder, and run a script that needs to access the file name. I know that %%BASEFILENAME_FROM_TRIGGER%% can give you the file name minus the extension, ...
0
votes
1answer
956 views

Creating triggered send without a data extension

Theoretically it should be possible to create a Triggered Send without an underlying Triggered Send Data Extension. The JSON passed to messageDefinitionSends REST call should still be available to the ...
1
vote
1answer
264 views

Dynamically Select Template based on template id field passed in DE

I want to select a template for sending email based on the template id present in Data Extension. So for all the subscriber with template_id(field in Data extension) ='123' should be sent the email ...
0
votes
1answer
4k views

Server-side JavaScript - how lookup rows in data extension in Marketing cloud

I just started using SSJS and the syntax is a bit new. I need to check if a subsriber exists in a data extension, based on email address. if (IsEmailAddress(submitterEmail)){ var requestsDE = ...
0
votes
2answers
343 views

Merge date/time field into email template AMPScript or SSJS?

I'm new to Marketing Cloud and I'm trying to find a solution to what I think should be a pretty easy problem. I have an email template in which I would like to insert a date/time, which will be ...
0
votes
2answers
1k views

SSJS Activities: Create Folder path

I am writing to know how can I do several actions on a Data Extension and Create Folder using Javascript by SSJS Currently I can not create a folder. I do not understand what is the problem . By the ...
1
vote
2answers
798 views

SSJS Activities : Move Data Extentions in a Folder

I'm investigating the SSJS activities. I'm not a JavaScript programmer but I'm trying to learn. Now I have managed to create Date Extension, a Create a folder path. Now I would like to be able to ...
0
votes
1answer
579 views

SSJS row retrieve keeps pulling 0 length

I am building a SSJS data extension row retrieve filter to pull out the values a person scored on a survey for certain areas. This is all taking place on a landing page in the SFMC microsites feature (...
1
vote
0answers
316 views

How to set SSJS InvokePerform() configuration options?

How to set the O2 argument in an SSJS InvokePerform() API function? O2 is referencing this documentation, also noted below. InvokePerform(O1,S1,A1) Use this function to ... read in documentation ...
1
vote
1answer
2k views

SSJS Update and Perform Query Definition

I am attempting to loop through data extension content to dynamically update and perform a query definition. Essentially, I'd like to update and run the same Query Definition synchronously using SSJS ...
0
votes
1answer
638 views

SSJS InvokePerform Query Definition

The status for this InvokePerform is coming back as undefined. Any ideas what is wrong with my code? <script language="javascript" runat="server"> Platform.Load("core", "1"); var ...
0
votes
1answer
431 views

SSJS Update Query Definition object to “update”

The intent is to update the TargetUpdateType property of a QueryDefinition object using SSJS. (reference) The following SSJS is outputting an error response to the QueryDefinition.Update() function: ...
0
votes
1answer
349 views

Call a Secured Web Service from SFMC

I have a task to call a secured web service from a SFMC Microsite. I understand this can be achieved by - Importing the Private Certificate on SFMC (Admin -> Data Management -> Key Management), but ...
0
votes
1answer
1k views

Using SSJS to dynamically build landing page content

How would this (or does this) translate to SSJS? This would be part of the HTML body of a landing page. %%[IF @var > 1 THEN]%% Show this content %%[ELSE]%% Show that content %%[ENDIF]%%
3
votes
1answer
2k views

Can we generate PDF in ExactTarget?

I want to generate PDF document on the basis of data available in my customer DataExtension and print it in proper format so that it can be sent to customer by a email. is there any AmpScript, SSJS, ...
1
vote
1answer
952 views

Displaying Dataextension row values in Landing page using SSJS

I am trying to display the row values in Dataextension based on the values submitted in the landing page form .Is there any way to display the retrieved value in HTML? And the code which i tried is &...
2
votes
0answers
3k views

Refresh Filtered Data Extensions automatically

In our system we have a ftp-triggered automation that imports a file into a data extension that is the source for hundreds of filtered data extensions which will be used for sending (and of course ...
2
votes
1answer
1k views

ExactTarget Editor - AMPscript / SSJS

Situation In ExactTarget (Marketing Cloud) it is possible to write AMPscript and SSJS. The only way I found for debugging AMP or SSJS is to create a public cloud page or to use email preview. ...
1
vote
1answer
749 views

SSJS Scripts in Emails evaluated twice

We need to create a record in a Salesforce [Sales Cloud] Custom Object each time an email is sent from a Sent Email Activity in Journey Builder. We've added an SSJS script in the email to retrieve an ...
3
votes
2answers
1k views

Setting a function to run at set intervals in a Landing Page in SSJS

I would like to run the following HTTP.GET function at a set interval (every 1 minute) until 10 minutes have passed or it has succeeded in retrieving the content. var contentRetriever = function(){ ...
1
vote
1answer
1k views

SSJS Rows.Update multiple fields

Can you update more than 1 field with SSJS Rows.Update? SFMC Documentation Update(object, filtercolumns, filtervalues) This function updates the specified row with the specified information. ...
1
vote
2answers
641 views

Retrieve value from XML response using SSJS in a SSJS Activity

Use a SSJS Activity I am getting a response in XML from an API call. I need to parse the XML for a specific value. Is this possible in a SSJS Activity?
0
votes
1answer
722 views

SSJS web API retrieve Column Names

I know this can be done via SOAP or an SDK, but I have a specific need to have this done in Marketing Cloud SSJS interacting with Web API (on a landing page, not in an email). The aim is to create a ...
0
votes
2answers
1k views

Include JSON Feed in an Email

Our company uses JSON feeds as datasources for our emails. We are moving over to ExactTarget and there doesn't seem to be much documentation surrounding this. How would you use a JSON feed instead of ...
2
votes
1answer
1k views

How do we delete subscriber from Auto Suppression List using SSJS?

Is there a way to delete subscriber from auto suppression list using SSJS? Any information is appreciated. Thanks.
0
votes
1answer
190 views

Retrieve an Email from Salesforce Marketing Cloud

Is there anyone who could tell me how to retrieve an Email from Salesforce Marketing Cloud? Assume that the Marketing Cloud Connector is already OK.
0
votes
0answers
361 views

How to trigger a snippet of code (AMPScript or SSJS) in Marketing Cloud?

I wrote a snippet of code with AMPScript + SSJS for email, and then I'd like to trigger it when emails' status are changed, but I can`t find any way to do this like as add a 'listener' in JavaScript. ...
1
vote
2answers
839 views

Use SSJS in Custom Activity

I was wondering if there is any possibility to create a Custom Activity that executes AMPScript or/and SSJS. If so, how could I read Journey context information to the SSJS? Thanks!
1
vote
0answers
447 views

Status of jquery.ajax from Server-Side Javascript

Please see the following codes: Front-side AJAX request code: function addAjax(emailIds, valObj) { var jqxhr = $.ajax( { method: "post", url: "mypage.aspx?QS=...
0
votes
1answer
1k views

ExactTarget Serverside Javascript: Is there any way to populate a list's attributes into a Data Extension?

I have a list and when using the following code: var myList = List.Init("TestList"); var subs = myList.Subscribers.Retrieve(); Write(Stringify(subs)); I retrieve these attributes: ID : 184408991 ...
1
vote
2answers
1k views

How to detect browser with AMPScript in ExactTarget?

I want to keep 2 URLs to one CTA which will navigate to the AppStore or Play Store depends the platform. Is it possible by using AMPScript/Server-side JavaScript in ExactTarget?
2
votes
1answer
402 views

SSJS: How to create an email and keep the personalization strings as variables?

I’m stuck trying to create an email with SSJS. I have the email being created in the account, but the required personalization strings (e.g. %%profile_center%%) in the HTMLBody and TextBody values ...
3
votes
1answer
4k views

Has anyone been able to create an automation through SSJS yet?

I've created a server-side JavaScript activity to create an automation, which is throwing an error: An error has occurred: {"message":"An error occurred when attempting to evaluate a CreateObject ...
0
votes
1answer
200 views

Is it possible to get personalization strings when pulling content from DE with Server-side JavaScript in emails?

I'm trying to use server-side JS to dynamically write variables based on the column headers of a data extension for an email. Then fill those variables with the row contents of those field headers. I ...
0
votes
0answers
677 views

What is wrong with this import activity being created through this SSJS?

I am creating an import activity through server-side javascript. The import is throwing an exception: An error has occurred: {"message":"Unable to retrieve security descriptor for this frame.",...
1
vote
1answer
887 views

Why is this QueryDefinition not working with InvokeCreate via SSJS?

I have a QueryDefinition that I am creating through server-side JavaScript. The query is not being created through the InvokeCreate method, though all appears to be well with the code. Please take a ...
1
vote
2answers
180 views

Capture customer info in new DE via a Link

Is it possible to capture customer information into a new DE by someone clicking on a link? As an example: capture the email address in a new DE by clicking on a link ( Click on this link to Opt-in)?
1
vote
1answer
502 views

Trouble Dealing With exacttarget List…without DE

We have a situation where get subscriberkey/email address from ET email and external site and i retrieve subscribers attributes IN THE LANDING PAGE (Hosted in the exacttarget) fields from the Exact-...
1
vote
1answer
3k views

Best way to make HTTP Requests

We are inserting data to a Data Extension in ExactTarget. Now on that same form submit action we have to POST that data to an Internal RESTful service (message format and responses are in JSON). Can ...
3
votes
2answers
1k views

After I Stringify a DE using DataExtension.Init how can I output or filter the data in JS?

I am wondering how can I filter data using JavaScript? For example, I would like to output data in JS. Platform.Load("Core","1"); var layouts = DataExtension.Init("DATA_EXTENSION_NAME").Rows....
1
vote
0answers
422 views

Retrieve Account Preferences via SSJS or AMPscript

Is it possible to retrieve the available business unit Preferences within Preference Management via ssjs or ampscript? I am interested in finding the available preferences and corresponding ...