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
0
votes
0answers
18 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
31 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 ...
1
vote
1answer
34 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 ...
0
votes
1answer
35 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
33 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 ...
1
vote
1answer
41 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
64 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
27 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();
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
0answers
35 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
1answer
32 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, ...
3
votes
0answers
51 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 ...
1
vote
1answer
48 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
16 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
35 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 ...
0
votes
1answer
32 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
60 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 = ...
2
votes
1answer
35 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
2answers
57 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
0answers
31 views

Deletes rows in a data extension Error SSJS

Can someone please help me? I want to delete data from Data Extensions, and I tried different variations. But unfortunately, it didn't work. For info I have so far used variant 1 without any problems. ...
0
votes
1answer
40 views

User is not unsubscribing when having + in the email

Facing an issue, I noticed some cases where users are unable to unsubscribe if they have a + symbol in the email address. Example - abc+cd@gmail.com Does anyone have the same issue before? any idea ...
0
votes
1answer
51 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 ...
0
votes
0answers
36 views

Need help in getting notification for Paused triggered sends

<script runat=server> Platform.Load("Core","1.1.1"); var mid = 'myorgMid'; var dev = 0; var allTriggers = 1; var alertEmailAddress = 'myemailId'; var ...
0
votes
0answers
30 views

Retrieve User Roles or Permissions in other BUs using SSJS

I have a few users that have access to different BUs. In each BU, they have different Roles (Permissions and PermissionSets), and I'm trying to get those Permissions/Roles that each user has in each ...
1
vote
0answers
37 views

Retrieve Business Units and add to data extension SSJS

I have the following SSJS function which uses WSProxy to return an array of all business units, however, when I test the script in a CloudPage, it returns an error. I'm hoping someone can take a look ...
0
votes
1answer
31 views

Can't display child elements of ParseJSON in SSJS

I'm trying to extract data and present it in a readable format (testing this out with a public API) <script runat="server"> Platform.Load("Core","1.1.5"); var ...
0
votes
1answer
40 views

Skip over bad records in SSJS loop and continue processing

I have created this SSJS Loop, but it will stop when a record is considered "bad". How do I skip over this record to continue the process? <script runat="server"> Platform....
0
votes
1answer
56 views

How to find attribute name with the highest value from a Data Extension?

I have those attributes with number type in a DE and want to get the attribute name with the highest value from a record. This following code is what I'm trying to do that purpose, the code didn't get ...
1
vote
1answer
26 views

Rows retrieve is not working as expected in Cloudpage

I have a DE named mock_data_only and its external key is set to the same string. I've tried doing a (SSJS) rows retrieve on this DE and wasn't able to do so. In cloudpage preview there's just a ...
0
votes
0answers
26 views

Is there any way to force a Connector synchronization of an object via SSJS?

I couldn't find anywhere in the API documentation, but is there a way to, via SSJS, force an entity synchronization on an object (Connector)? The issue I'm running into is I created an automation ...
0
votes
0answers
20 views

Import Crypto JS Libraires, Generate Encrypted one and update to DE [duplicate]

Use-case: After FB leads insert into DE, i have to do a encryption on the email address and update the DE to one of the field, I have to use base64encode, HMACSHA256. i am able to retiever records(...
0
votes
1answer
77 views

Bulk delete rows from Data Extension using WSProxy

I am looking to delete rows from "ProxyTest22" data extension and trying to achieve this through WSProxy as the number of rows are in millions. I keep getting Error executing delete call.\r\...
0
votes
2answers
91 views

How to create dateadd function in SSJS by calling dateadd in ampscript

I'm trying to create a dateAdd function in SSJS by calling the dateAdd function in Ampscript. The code below works. But I cannot figure out how to make the date argument dynamic. This means the ...
0
votes
1answer
44 views

How to retrieve content block in SSJS

I'm trying to retrieve a content block for a script in ssjs. I tried already several functions but it seems not working. The scope is with a script to retrieve a content from a content area and push ...
-3
votes
1answer
32 views

Populate output of all values in the loop in SSJS

I have the following code and I would like to get all the values in that loop as output. Can someone tell me the function/process we use to get that result? <script runat="server"> ...
0
votes
0answers
80 views

Update sales cloud object field from cloud page landing page using ampscript

Step1:Code1 I am processing on click of a unsubscribe button with a checkbox. Step 2: Code 2 processing the list for unsubscribing using amp script. Step 3: Code 3 It is updating the object field in ...
1
vote
2answers
145 views

How to Update a Data Extension through another Data Extension?

Hello Salesforce Community, I'm new in Programming (around 6 months with JavaScript and Java) and even more rookie in Marketing Cloud (going to my second week) and I'm exploring a use case for a ...
1
vote
0answers
65 views

How to wait untill UpsertData is done using SSJS?

I'm running a for loop to update some DE records. Since the LookupRows is limited to 2000 records, we sometimes need it to iterate again. Therefore the for loop is in a while loop. Rows are marked in ...
0
votes
0answers
31 views

Help with SSJS Complex Filter

I've been working on the filter below but it does not return any result. Can you guys please tell me what's wrong with my code? Thanks! Goal is to find a record where ClientId_Boxhill = CenterClientID ...
0
votes
1answer
50 views

Creating a new dataextension in a new folder using SSJS

I would like to write a single SSJS script that creates a new folder within the Shared Data Extensions tree, and then creates a new Shared Data Extension inside that folder. I'm able to create the ...
0
votes
0answers
47 views

Using SSJS to delete rows from DE's with more than 25 million rows

I have scrolled through these pages but can't seem to find a solution. Here's hoping someone can help me out :) I am using the below SSJS in an Automation to remove rows with IsDeleted = 'True' from a ...
1
vote
1answer
30 views

Send progress of CloudPage back to browser during AJAX request

I'm processing CSV files with a CloudPage. I upload the CSV file, then stringify the array, and send it via AJAX to another page. Previously, I had been doing this row by row so that I could show a ...
0
votes
1answer
63 views

Calling SSJS from inside a Journey?

Does anyone have any clever ways to execute SSJS from within a journey? I have some ideas but would love to hear yours. My use case is to listen for new Salesforce CRM records to be created. When ...
1
vote
1answer
130 views

SSJS: read response headers from Script.Util.HttpRequest object in SFMC

We need to retrieve the response headers from an HTTP GET call issued in SSJS with the Script.Util.HttpRequest function. Unfortunately, even though it seems straightforward and the task itself is ...
0
votes
1answer
62 views

SSJS Error on HTTP.Post

I'm facing an issue on sending an HTTP post request from Marketing cloud to ElasticSearch using SSJS. The aim is to send some import statistics of flat files to ElasticSearch in order to retrieve it ...
0
votes
2answers
59 views

SFMC: SSJS script for retrieving data extension names from a folder and place the DE names in another (target) DE [closed]

We have a requirement to retrieve the list of data extension names or external key values under a folder in SFMC and store them in another (target) data extension. I have tried this option mentioned ...
0
votes
1answer
29 views

Need a specific name/value pair from a JSON response

I'm using SSJS, and I have an API call that returns the following JSON response: {"StatusCode":200,"Response":["{\"id\":\"4623abc695724f0190e369a1c0f71f94\"...
1
vote
1answer
43 views

WSProxy to retrieve TriggeredSendSummary report

We are creating TriggerSend Dashboard Report in Cloud pages. We are able to process it using AMPscript and SOAP API call, but unable to process AMPscript SOAP API response. We have decided to use ...
1
vote
0answers
77 views

SSJS In Custom Activity

We currently have a custom activity used to send SMS, we are wondering if anyone has had any success making Ampscript/SSJS accessible within a custom activity in Journey Builder. The idea here is that ...

1
2 3 4 5
14