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
4
votes
2answers
4k views

Using AMPscript with SSJS Activities

I have tried using the below AMPscript block in an SSJS Activity, however it appears that Script activities only support SSJS and AMPscript cannot be included in Script Activities — please can someone ...
4
votes
2answers
3k views

REST API Methods in AMPScript or SSJS

Is there any way via AMPScript or SSJS to utilize HTTP methods outside of GET and POST? I have had no problem utilizing these two via the HTTPPost() and HTTPGet() functions, but have not found any ...
1
vote
1answer
1k views

Server-Side Javascript calling SOAP API

Does anyone see why this SOAP Request would return a 500 Internal Server Error? If I just pull out the payload test and run it in SOAP UI I get a correct response? <script language="javascript" ...
0
votes
1answer
2k views

Date manipulation Function SSJS

I want to delete the records from Data Extension based on Date Field in my DE i.e. I want to delete record which were created date before 30 days.But I didn't find date manipulation function in SSJS ...
2
votes
1answer
1k views

Landing Page post to itself and run SSJS

i found a great blog post by Adam Spriggs https://sprignaturemoves.com/prune-rows-data-extension-ssjs/ He mentioned to execute this function be built a landing page that posts to itself and calls ...
1
vote
1answer
2k views

SSJS Retrieve DataExtension Rows by RetrieveRequest

Is it possible to retrieve all rows for a DataExtension with a RetrieveRequest? I'm blocking by 2500 max-retrieve function restriction. My cloudpage blocked, when I repeat two or three times this ...
1
vote
1answer
513 views

Making SOAP Calls via SSJS

I am trying to make a SOAP call following from the answer here : Server-Side Javascript calling SOAP API I am running this on a cloud page. When I publish it, it doesnt render (harbinger or bad ...
0
votes
1answer
635 views

Parse XML in Server Side Javascript

Is there a way to parse XML in SSJS. I have an RSS Feed that comes as XML in the response, is there a way I can parse the field and store them in a Data Extension, using SSJS. I have tried standard ...
3
votes
1answer
709 views

How to set a cookie using SSJS?

This question relates to: Is it possible to add http headers. for example set-cookie, via ampscript or ssjs in ExactTarget? The answer on that question does not specifically call out how to set a ...
1
vote
1answer
175 views

Get current location with ampscript or ssjs

I have functionality on a cloud page that depends on the cloud page url. I know how to Requestparameter(), but how do I get the entire url using ampscript or SSJS?
0
votes
2answers
614 views

How can I obtain the status of an automation in a Business Unit using AMPscript?

I am attempting to retrieve the status of an automation in a Business Unit with the following AMPscript, but I haven't been successful yet. Could someone please assist? %%[ SET @key = "###" SET @...
4
votes
1answer
2k views

Making a REST API call from a Script Activity in Automation Studio

We are trying to update a service cloud custom object from marketing cloud. Can we make a REST api call within a script in Automation Studio.It will be great if someone in this forum can confirm they ...
9
votes
1answer
149 views

Using AMPscript/SSJS how do you unsubscribe a subscriber from a child business unit?

My goal is to create a page that passes a business unit id and a subscriber key. The page sits on the parent/enterprise business unit, it will receive business unit ids from a child business unit. ...
3
votes
2answers
3k views

AMPscript / SSJS learning resources

I'm fairly new to using AMPscript and SSJS and am looking to use both in future email campaigns. However, I'm having a very hard time finding any learning resources outside of the SFMC documentation. ...
0
votes
1answer
421 views

Marketing Cloud SSJS: trying to automate contact deletion

with the GDPR laws in place, it's important to have the possibility to remove contacts from Marketing Cloud. I'm trying to automate the process with existing tools and am looking for possible ...
0
votes
1answer
1k views

Create a Complex Filter Definition via SSJS

I am looking to do a 'Create Filter Definition' (to initially create these filters) and then an iterative 'Update Filter Definition' to mostly automate our constantly changing campaign requirements - ...
3
votes
1answer
2k views

Is it possible to call external SOAP/REST API in ExactTarget?

Is it possible to call external SOAP/REST API in ExactTarget? I want to call external SOAP/REST API in landing page and need to use SSJS. I tried to search in ExactTarget wiki but didn't get any ...
2
votes
1answer
801 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.
2
votes
1answer
79 views

SSJS Error retrieving the automation activities of an automation

I'm trying to use SSJS to retrieve the automation activities of an automation, using this code: var api = new Script.Util.WSProxy(); var cols = ['Name', 'CustomerKey', 'AutomationTasks']; var ...
1
vote
1answer
348 views

How to improve this SSJS

Recently started to learn SSJS and wrote the script (for automation studio) which is located below. What i am interested in is: How can i improve this Server Side JavaScript performance wise? For ...
0
votes
1answer
123 views

SystemDateToLocalDate inside SQL Automation

I know the function SystemDateToLocalDate is not available inside SQL but i would like exactly that feature inside an SQL query to convert the Date records of data_views (which are CST Central ...
0
votes
1answer
610 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 ...
0
votes
1answer
2k views

Error Handing in Ampscript

I have used Server side javascript with a mix of ampscript to handle the error but the issue is even for the correct syntax the page is being redirected to error. When i remove the SSJS exception ...
4
votes
1answer
990 views

Failure to retrieve list subscriber attributes in a landing page using AMPScript and SSJS

ExactTarget is core edition. There are no Data Extensions, so we use Lists. Am using landing page and trying to retrieve all the subscribers attributes of the List from SSJS and AMPScript but failed ...
3
votes
2answers
787 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(){ ...
2
votes
0answers
204 views

Getting Error while trying to trigger API event in Journey From Landing pages using ssjs?

I'm working creating a trigger API event in Journey builder from landing pages. I am currently able to get the accessToken using clientId & clientSecret, but then I tried to pass subscriberkey &...
2
votes
1answer
544 views

Loop HTTP.Get requests in SSJS

I'd like to make multiple HTTP.Get requests in a Script Activity, based on the number of rows returned from a LookupRows function. The issue is that it only makes the HTTP.Get request once, for the ...
1
vote
2answers
1k views

SSJS Landing Page access POST JSON Request payload

I would like to POST to an SFMC SSJS Landing page using AJAX. Is there any way to access the POST JSON Request Payload using SSJS in the Landing page?
1
vote
1answer
112 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 ...
1
vote
2answers
514 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 ...
1
vote
1answer
716 views

SSJS script to update Salesforce object

How to update Salesforce object (eg. contact or lead) from Salesforce Marketing Cloud using Server Side Javascript ?
1
vote
2answers
166 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
2k 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 ...
1
vote
1answer
264 views

How can an Automation be deleted using ExactTarget SOAP API?

I have a delete request coded using the SOAP API and the response back is: AutomationDelete:["Delete Access is denied!", 0]"Error" Is the action truly denied or am I not writing the code properly? ...
0
votes
1answer
475 views

SSJS Functions in Automation Studio

I am trying to create a Data Extension using SSJS Script through Automation Studio. My script is as follows: <script runat="server"> platform.load("core","1.1"); var deObj = { ...
0
votes
0answers
96 views

URL Concatenation is not working in the content area generated by SSJS

URL conacatenation is not working in the content area generated through SSJS script .The scenario is we are generating a content through SSJS and its stored in the content area and its then pulled ...
0
votes
1answer
352 views

AMPScript for loop and SSJS

As the subject says, I would like to use two line of SSJS code in a for loop like in the example: VAR @listAddress, @nameChosen, @Counter, @i, @AddressRow, SET @listAddress = ...
0
votes
1answer
935 views

How to create simple HTML forms in Salesforce Marketing cloud email templates?

I am trying to create a simple form with one or two fields in the email templates.I have created the same before in landing pages and I am not sure we can achieve the same in email templates .And my ...
0
votes
2answers
911 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 ...
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 ...
0
votes
3answers
163 views

Clearing a Data Extension using SSJS with SOAP

I am using the below SSJS to clear out a data extension. It works well in the Parent BU but when I run it in a Child Business Unit it fails <script language="javascript" runat="server"> ...
0
votes
1answer
80 views

How to publish page while using Platform.Variable.GetAttributeValue

I am building a custom preference center in SFMC with SSJS that will pass the subscriber context into the landing page via the microSiteUrl() from an email. I am building and testing JUST the landing ...
0
votes
1answer
332 views

How to catch selected radio button with requestParameter?

This it was asked before but the user deleted the question https://webcache.googleusercontent.com/search?q=cache:ZkynvIeVHUYJ:https://salesforce.stackexchange.com/questions/211141/how-to-catch-...
0
votes
1answer
238 views

Code snippet creation in Automation Studio script

I want to create a code snippet from an automation studio script activity. Implementation works perfect in a landing page. But during the automation execution I got an error: {"Status":"Error","...
0
votes
0answers
533 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.",...
0
votes
1answer
289 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 ...
0
votes
1answer
1k views

Using AMPscript in a Script Activity

We need to update a record in Salesforce using a Script Activity within an Automation. Ideally, I would like to use the AMPscript UpdateSingleSalesforceObject() function to achieve this as there is no ...