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
10 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
1answer
503 views

More detailed error reporting for SSJS failing?

We have a script which runs in an automation which retrieves registration data from our events management platform. The automation recently stopped working, and the problem was with the javascript ...
0
votes
1answer
22 views

How can I retrieve a list of Data Extensions in a folder using SSJS

I would like to output a list of Data Extension names (and their customer keys) from a specific Data Extension subfolder. Is this possible using SSJS?
1
vote
1answer
24 views

Inserting Into Data Extension From External Key In Another Data Extension With SSJS Not Working

I am attempting to insert data into a DE, which I create from the FuelSDK, using a Script Activity, I created as part of an Automation, in Automation Studio. The script runs, but no data is inserted ...
1
vote
1answer
53 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 ...
1
vote
1answer
68 views

Using SSJS to randomise a string

I'm picking up salesforce marketing cloud and refreshing myself in AMPscript/SSJS. Could you give me some feedback on the following snippet? I don't have access to SFMC to test out, so I'm just ...
0
votes
2answers
50 views

How to Add a subscriber to a list using ampscript or ssjs in SMS message

I need to add a subscriber to a list particularly the All Subscriber list, for cloudpagesUrl to work since it returns a broken link if the subscriber is not in the all subscriber list. I already ...
0
votes
2answers
406 views

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

I have a landing page that I am using SSJS to submit form fields to a data extension. The form fields contain HTML characters (which will import to the Data Extension fine) but, trying to update the ...
0
votes
1answer
37 views

How Do I Send an HTTP POST API Call Through a Script Activity Using Basic Auth?

I have seen a few posts about how this can be done using oauth, but I need to use basic auth and I can't seem to get it to work. Below is an example of the code I'm using. <script type="javascript"...
3
votes
1answer
41 views

Check IBAN validity function in SSJS

I found a piece of client side Javascript code to check the validity of an IBAN bank account number here: https://stackoverflow.com/questions/21928083/iban-validation-check Now I'd like to use this ...
6
votes
1answer
138 views

Caching HTTP Get calls in SFMC for emails

I've got a email which does a HTTP Get call using SSJS Platform.Function.HTTPGet, results return JSON and I can parse it successfully. Would the calls get cached or would a Get call happen per ...
0
votes
1answer
875 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 ...
1
vote
1answer
60 views

Update Salesforce object through ampscript

I was trying to update account object through ampscript using UpdateSingleSalesforceObject this function,the result is returning zero value,is their any permission is need to be provided for accessing/...
1
vote
1answer
411 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 ...
1
vote
2answers
1k views

SSJS to delete rows from a data extension via a lookup table

Is there a way to delete selected rows from a Data extension(MASTER_DE) by looking up another data extension as a lookup (to identify the subscriber keys that need to be deleted) using SSJS? I have ...
0
votes
1answer
55 views

API call to external system to pull data to marketing cloud

Is it possible to make an API call from the marketing cloud to pull data from external system? One way to do it create a script activity and schedule it or calling the activity through API. Real ...
0
votes
1answer
19 views

Convert Reports values into numbers from strings in a script activity

I want to perform a script activity on an Account Send Summary report I dropped into a Data Extension. The current numbers inside of the system cannot be logically filtered because they contain "," ...
1
vote
1answer
76 views

Marketing cloud Contact deletion using ssjs

I am new to marketing cloud, can anyone tell me how to automate contactdeletion process using new OAuth 2.0. Using legacy the process works but not able to proceed with OAuth 2.0. <script runat="...
0
votes
1answer
119 views

Fields.Retrieve() doesn't display anything

I would like to retrieve the header of a data extension using SSJS within my Landing Page. Below is my code : <script language="javascript" runat="server"> Platform.Load("Core", "1"); ...
1
vote
1answer
151 views

How can I update a Publication List status in a child Business Unit using SSJS?

The following code updates the Publication List status in the local Business Unit of the Landing Page, but I've got over 30 Business Units and I'm looking for a way to update all the publication lists ...
-9
votes
3answers
87 views

How to use trim() function in SSJS using data extension in Marketing Cloud [closed]

How do I use trim() functions in SSJS? Using Data Extensions. Can you please provide some examples? I have a Data Extension, where "Message" is an Attribute. In this Attribute how do I use the trim(...
1
vote
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 ...
3
votes
1answer
46 views

How Can I Programmatically Update Multiple non-sendable DEs to be Sendable?

I have a cleanup I'm working on and hitting a wall. We use email address as the subscriber key. I have a few hundred DEs with an "email" column that are NOT marked as sendable. I want to update them ...
0
votes
2answers
40 views

Unable to retrieve security descriptor for this frame error in HTTP POST request SSJS marketing cloud

I am trying to post a request to my site and I am using SSJS HTTP post method. But the POST request is throwing error "" Unable to retrieve security descriptor for this frame. Im not sure what i ...
0
votes
4answers
3k views

Why is SSJS HTTP Post request failing in CloudPages and Script Activities

I am trying to execute some SSJS to store my Marketing Cloud API token into a DE but the script does not seem to work when I run once, as its an activity no error messages are returned so I can't tell ...
0
votes
1answer
50 views

SSJS and AMPscript

I'm trying to output message if there is an error and i have very little knowledge in javascript in general. Could I get some feedback on if the following would work or how I would go about : If ...
0
votes
0answers
54 views

The 'Content-Type' header must be modified using the appropriate property or method.\r\nParameter name

I am making a Http get request to 3rd party api using SSJS. each time i make a call is get below exception: e: {"message":"An error occurred when attempting to evaluate a Util.HttpRequest call. See ...
1
vote
1answer
70 views

SSJS Script not Looping Through

I have some code which doesn't seem to loop through the i variable incrementally... any ideas where I'm going wrong? <script runat="server"> Platform.Load("core","1.1"); var DE1 = ...
-4
votes
1answer
50 views

How to create a task for Salesforce cloud crm using ampscript [closed]

Please advise how to create a task for Salesforce object in MC using ampscript.please let me know is this functionality is achievable Regards Shiva
2
votes
2answers
614 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 ...
0
votes
2answers
46 views

How to separate json response in different variables? [duplicate]

How do I separate this response in one variable, like I required from below response URL only in one variable? However, "BE050-A28" this value is dynamic in every response. { "vehicle": { "...
0
votes
1answer
72 views

How to insert csv file record inside data extension from cloud page?

I have created a cloud page where I have provided browse button and after selecting CSV file I am reading CSV file in the script so there are 100 contact records in csv and I am sending WhatsApp ...
1
vote
1answer
28 views

Status of adding data extension with SSJS

I am using Add() function to add a new data extension and I would like to access a status message if possible. I am using following code var deObj = { "CustomerKey" : "demoDE", "Name" ...
0
votes
2answers
349 views

Marketing cloud Unable to retrieve security descriptor for this frame. SSJS

I am trying to get a json object from my email template using SSJS. Here is my code: <script runat=server> Platform.Load("Core","1.1.1"); var responseContent = HTTP.Get('https://api....
0
votes
1answer
28 views

ParseJSON Error for HTTPPost - SSJS Unable to retrieve security descriptor

In my marketing cloud, landing page. Getting the error "System.InvalidOperationException: Unable to retrieve security descriptor for this frame" while trying to Parse the JSON response in a HTTP Post ...
4
votes
1answer
70 views

Identify the Type of an Automation Activity using SSJS WSProxy

I'm trying to create an API call that will return the SQL Code from all Query Activities within an given Automation. Using the information provided in this question Retrieve multiple tasks in an ...
1
vote
1answer
68 views

Is it possible to create Script Activities through Marketing Cloud API?

I am developing an application to interact with our Marketing Cloud and I would like to be able to create custom Script Activities(containing SSJS API calls)through the API for each campaign so I can ...
-2
votes
1answer
47 views

ParseJSON array [closed]

I am trying to achieve the following. I have JSON with array: apicall = { "CallID":"123", "Response":[ { "Header1":value1, "Header2":value2, "Header3":value3 } ]} And I would like to parse the ...
0
votes
1answer
614 views

SSJS script does not update a Data Extension field when using running the script via the Script Activity in Marketing Cloud

I am trying to run the script below in the Marketing Cloud Script Activity to update data in a Data Extension: <script runat="server"> Platform.Load("core","1"); try { var ...
1
vote
0answers
49 views

Correctly parse JSON

I am trying to make a call to external API but I don't know how to correctly parse results. Here is the format of the response. I can correctly parse the Status, but Results is an array and nothing so ...
0
votes
1answer
80 views

How can I add data to Dataextension for SSJS

I am trying to add data to Data Extension using SSJS Script through Automation Studio. 1.I want to HTTP GET(ThirdParty's recomend) 2.I want to catch response(JSON) and add data to Dataextension How ...
0
votes
2answers
511 views

How to display Date (Format 'DD/MM/YYYY') in a single input type textbox in cloudpage

I'm trying to display a Date in a single input type textbox in Cloudpage, the data will be coming from Data Extension. I tried changing the type to date : <input type="date" name="...
2
votes
1answer
50 views

SSJS equivalent of DecryptSymmetric

Knowing that we have EncryptSymmetric and DecryptSymmetric in Ampscript, both with the ability of referencing password, vector and salt, from Key Management - is there anything similar in SSJS? If a ...
-1
votes
1answer
41 views

How to remove a record from a publication list using scripting [closed]

Can please help me to how to remove a particular record from publication using scripting(ssjs/api ampscript) Thanks, Shiva
2
votes
1answer
49 views

How to obtain error status of automation via SSJS

I have the below SSJS which gives the status of scheduling in automation. But it doesn't give the status of automation: For example, if my automation errored, then am getting the status '6' which is ...
0
votes
1answer
592 views

How to check the subscriber is available in all subscriber list records using AMPSCRIPT or SSJS

AMPSCRIPT: %%[ var @subkey, @availuser set @subkey = AttributeValue("_subscriberkey") SET @EArows = LookupRows("_Subscribers","SubscriberKey","mycenter+10@gmail.com") IF ROWCOUNT(@...
0
votes
1answer
31 views

Update SQL Query Text via SSJS

I have written some simple code which i will try to loop later but I am getting no success in trying to use SSJS to update SQL queries. I don't need to perform the actual query i just need to update ...
2
votes
1answer
534 views

Error retrieving a List Object in SSJS

Error given: Object of type 'System.String' cannot be converted to type 'System.String[]'. Code: <script runat="server"> Platform.Load('core', '1'); var status = [null, null, null]; Write(...
0
votes
0answers
22 views

Using SSJS WSProxy within Postman to directly make SOAP API calls without needing the Soap XML request body

So far I've been able to use Postman to pass values to a SFMC Landing Page or CloudPage that hosts SSJS WSProxy to execute a particular SOAP API requests such as updating a data extension that occurs ...
0
votes
1answer
1k views

Redirect to error page via SSJS

I am trying to error Handle my Cloud page in SFMC. If anything goes wrong in the Ampscript Block, user should be redirected to an error page. There is a success scenario where I redirect the user to ...