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
0answers
24 views

Contact Deletion in Automation Studio with SSJS

Basing on the article here I prepared a code snippet to run in Automation Studio. Unfortunately we receive Bad Request(400) error for second API call everytime even though all passed parameters are ...
1
vote
0answers
30 views

Is it possible to make a Cloud page return a Status Code 400?

In the context of using a Cloud page as an endpoint for an API call, I was wondering if it was possible to make a Cloud page return content with a different Status Code, such as 400 for example. In ...
0
votes
1answer
25 views

SSJS code to fetch the json response returned in the browser after authentication in Marketing Cloud

I am trying to connect My Cloud page to Google Sheets. In my Cloud Page I have embedded this code - https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get?apix_params=%7B%...
1
vote
2answers
730 views

Trying to trigger an automation from different Business unit using SSJS Activity

I have written the below code and created one test scheduled automation to start the automation. I didn't get any error when i did scheduled/publish the code but my automation is not starting. and i ...
-2
votes
0answers
28 views

SSJS script to update a date field based on another date field based on days in the next month in marketing cloud [closed]

I have a requirement to update a date field (bill_date) based on 2 fields (another date field(order_activated_date) and bill_cycle field). If bill_cycle is 1 and my order_activated_date is 8/4/2021(...
0
votes
1answer
32 views

Follow-up— Retrieve SFMC Data Extension Rows, by fieldname

Follow-up to a similar question. I'd like to be able to access the rows[i] by field name, and saw something similar in another example, but I couldn't get it to work. In the code below, SubscriberKey1 ...
0
votes
1answer
38 views

Code resource GET request issues

I have a set of three pages that I developed in a development instance; HTML page, a JS code resource responsible for GET requests and a JS code resource responsible for POST requests. In the ...
1
vote
0answers
388 views

Retrieve SFMC Data Extension Rows and Update 2nd Data Extension using SSJS

I have created two Data Extensions. I am attempting to use a Script Activity to update Data Extension B based on the contents of Data Extension A. I have attempted to do so with SSJS retrieve request, ...
0
votes
3answers
622 views

Submitting HTML characters to a Data Extension via Landing Page and SSJS

I have tried to push data to data extension through a landing page using SSJS. The form fields contain HTML characters (which will import to the Data Extension fine). I'm getting this error when I ...
1
vote
1answer
721 views

Create a Automation Studio Dashboard on a Marketing Cloud Cloud Page

I Want to Create a dashboard where all Automations and there status in the Account is displayed. old post on the topic I Want to push all Automation object data to a data extension. This can only be ...
1
vote
1answer
469 views

Server Side JavaScript to create a filtered data extension?

The Salesforce documentation provides helpful examples of creating regular data extensions using SSJS, but no example for creating a filtered one. Does anyone have a code sample for creating a ...
0
votes
1answer
93 views

Using code snippet in Exclusion Script Triggered Send

I'm trying to create an exclusion script based on the output of a Code snippet which looks like: <script language="javascript" runat="server"> Platform.Load("core",...
0
votes
1answer
28 views

Extracting ObjectID of an Automation

I am not sure what I have done wrong but I am not able to extract the ObjectID of an Automation. Here is my code var prox1 = new Script.Util.WSProxy(); var cols = [ "Name", "ObjectID&...
1
vote
1answer
33 views

SFMC SSL certificate in Third Party API request

I want to call a Third Party API that requires a SSL certificate. How can i use a SSL certificate for these request using SSJS or Ampscript?
2
votes
1answer
74 views

Connect SMFC to Github

Has anyone had any success connecting things like content builder or cloud pages to GitHub? I have been searching far and wide and have come across this amazing repository that almost does what I need ...
0
votes
0answers
23 views

SSJS Execute SQL and Retrieve Result

Within SSJS, i want to execute SQL to retrieve a filtered data set from data extensions and views. Then i want to insert that data as a payload into a destination DE. I got the second part working ...
1
vote
1answer
31 views

Using SSJS filter NotContains

Has anyone have success of using SSJS filters to exclude data that contains a particular string? I am trying to get a list of Marketing Cloud users that the AccountUser.Name doesn't contain the word '...
0
votes
1answer
30 views

Using landing page to receive data from a callback

I am using MC Event notification Service and I created a callback (using a 3rd party site) to receive data posted back from Marketing Cloud. I want to see if I can utilize a landing page to receive ...
0
votes
1answer
53 views

How to delete rows from DataExtension having no Primary Key, and exist in different Business Unit?

I refered this approach to delete rows from Data Extensions having no primary key. But this require to put SSJS script into every business unit. I tried with WSProxy by setting different clientId , ...
0
votes
3answers
66 views

ClaimRowValue In SSJS alternative [closed]

Is there an alternative to the ClaimRowValue function in SSJS? this code in AMPScript %%[ var @couponRow var @couponCode var @CustomerID set @CustomerID = AttributeValue("CustomerID") set @...
0
votes
1answer
811 views

Access status of last run of an automation using SSJS

I need to get the status of the last run of an automation through SSJS. The context: there are several automations that will run and if all of them are successful I need to start another automation ...
0
votes
1answer
576 views

How to create content Block in content Builder through ssjs in marketing cloud

I am trying to create content block in content builder using ssjs code but I am getting error, please check below code and how to resolve the issue? <script runat="server"> Platform....
4
votes
3answers
3k views

Server-side JavaScript and JSON

I would like to extract the data from a Data Extension column and parse it as JSON and use the data as attributes in an email. How would I go about doing this? Is there a combination of AMPScript ...
0
votes
0answers
19 views

Update Auto suppression List

I want to update the auto suppression list as a result of a query activity I used this script activity https://gist.github.com/eliotharper/d3673ce31c79e2ccd3b31843a5724f6c ` <script language="...
1
vote
1answer
43 views

Landing Page preview REST API in Marketing Cloud

We have a static landing page (no forms to submit) with some dynamic content like disclosures. The static content doesn't change much, but the disclosures do and the disclosure have all the legal ...
0
votes
1answer
31 views

How to unsubscribe / Opt out MobileConnect using SSJS?

So far I found only APIs, is there a more simple code oriented way for that? Like there is to Emails with: var subObj = Subscriber.init(subkey); var status = subObj.Unsubscribe();
1
vote
1answer
45 views

Fetch the email name used in Journey via ssjs

I am trying to create a cloud page in which when I enter any journeys name with the click of a button I should get the name of all the emails used with that Journey. Some of these journeys in my ...
1
vote
1answer
626 views

Create automation by SSJS

Is it possible to create an automation by SSJS, object type CreateRequest does not exist and I don't know how create that entity in my system. I using this code but last lines gives me an error. <...
0
votes
1answer
47 views

Retrieve page url in SSJS or AMPScript [duplicate]

I need to get the full page url on my Cloud page. When I try to do it through window.location.href then I get null. Is there any way using SSJS or AMPScript to get the full page url?
0
votes
1answer
41 views

Update field in DE using Rows.Update with multiple search keys

I'm trying to update a field in my DE. And I want to search Row with multiple keys in method with this code: function setRegisreField(dataExtensionKey, firstKeyValue, secondKeyValue) { var ...
0
votes
1answer
67 views

Delete individual record from Data Extension through cloud page

Very pleasure for the solution. Want to delete individual/particular records from landing page, but unable to delete. <table width="100%" cellspacing="0" cellpadding="0&...
0
votes
1answer
2k views

SSJS - List of HttpRequest methods available and their options for Marketing Cloud

I was looking to see if we have list somewhere that shows the various methods and their possible property values for the HttpRequest function within SSJS in the SF Marketing Cloud. This would be used ...
1
vote
1answer
53 views

Journey Handling: Deleted or non existent subscribers

Scope: Journey Builder Main Problem: Dealing with deleted / unsubscribed and never existent subscribers inside a journey. These kind of subscribers shall not receive emails from E-Mail Activities ...
0
votes
1answer
28 views

Display multiple Trigger sends email names on landing page

I want to display the names of all the trigger send emails present in the account on landing page. A user should be able to select the one name from this list (Like dropdown list). I have tried for ...
0
votes
1answer
38 views

How to use SSJS in side the email template content?

I have try to use SSJS and AMP scripts using microsite urls its successfully working. I am struck when I use directly SSJS and AMP script in inside email template. Using SSJS how to retrieve, insert, ...
5
votes
1answer
1k 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 ...
1
vote
1answer
752 views

Using API call in SSJS

I would like to know if we can do an API call Using SSJS. My need is to extract data from a data extension and target an end point using API call. The SSJS is unfortunlly not documented very well. I ...
3
votes
0answers
65 views

How to feed IER (individual email result) with Tracking Triggered Send information (triggered send via API from external app)

i hope someone can help me with this problem here: i've to feed the IER "et4ae5__IndividualEmailResult__c" object in SalesCloud from Tracking data of Triggered Send. Normally with the ...
0
votes
1answer
238 views

Parsing Array JSON response using SSJS activity in the automation. not giving any output- Parsing array inside the array [closed]

<script runat=server> Platform.Load("Core","1.1.1"); try{ var newpay = Stringify({"failedRecords":[ { ], "offerid": &...
1
vote
1answer
52 views

Retrieve data for another BU

I have a cloud page in one BU. And i need to retrieve data from DE in another sibling BU (and DE is not in the Shared folder). I wrote this code, but it does not display anything. Can anyone help me ...
0
votes
0answers
17 views

AMPScript: Can I cast a value as a variable?

I'm doing a lookup of a data extension and bringing a name-value pair back in my code. Is there a means of casting the result as a variable name? FOR @preferencePageIndex = 1 TO RowCount(@...
0
votes
0answers
37 views

Not so public cloud pages in Marketing Cloud

I am building a cloudpage but want to restrict it to be visible only within my company network. I have a solution and it is working. I created a DE with the list of accepted IP ranges and used SSJS ...
-1
votes
1answer
32 views

Is there a best practice for the number of script activities in an automation?

I'm creating an automation that may need to have upwards of 20 script activities, in order to process 40,000+ records as there's a governor limit of 2500 in Rows.Retrieve. What's the best practice ...
2
votes
1answer
2k 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 ...
1
vote
1answer
2k 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" ...
2
votes
1answer
40 views

WSProxy - is it possible to move categories / automations?

With the new year I am trying to create a fresh start by cleaning up old folders and files from our MID. It's quite a tedious job to move folders and files manually within automation studio. I am ...
0
votes
1answer
44 views

Retrieve status of automations of all child BUs from enterprise BU

Below is the code which I tried, but when the automation is erroring out the status is populating as paused, scheduled, stopped. The error status is not population. Code: <style> body, a, ...
0
votes
1answer
87 views

Lookup with SSJS in Marketing Cloud

<script runat="server"> Platform.Load("core","1.1.5"); var str = Attribute.GetValue('Test_JSON'); var obj = Platform.Function.ParseJSON(str); var val = ...
0
votes
2answers
84 views

SSJS unable to Parse JSON using the Platform Script.Util.HttpRequest

For a cloud page, I have a use case, where using the Script.Util.HttpRequest/Response I get the OAuth token. Then I have another request, the response structure of which looks like below: { "...
0
votes
1answer
58 views

Send data from one CloudPage to Another

I have a cloudpage that register some customer infos(Fname, Lname, Id...), and theses info needs to be transferred to another CloudPage in order to display the correct Content for that Customer, I'm ...

1
2 3 4 5
14