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

pass parameters from a smart capture to another landing page

i am modifying a SmartCapture to send captured parameters to another landing page but they do not travel through the url. it redirects fine to the other landing but the parameter is not sent, this is ...
1 vote
1 answer
1k views

SSJS - Rows.Retrieve() return empty array

I tried to get all rows from DE by DE name, I got an empty array. For the test, I tried to add a new record to this DE before the read function. Edit: This is a Shared Data Extension My code: &...
1 vote
1 answer
104 views

Get complete URL with parameters in SSJS/Ampscript

Here's how to get the URL of current page (with parameters) in SSJS: var url = Platform.Request.RequestURL(); Effectively, it's the equivalent of RequestParameter('PAGEURL') in AMPscript. However, ...
1 vote
1 answer
1k 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
1 answer
55 views

Get MID from CloudpagesURL()

I am trying to create an unsubscribe page at the parent BU level for multiple child BUs. I want to use impersonatation with WSProxy in order to log the unsubscribe at the right BU, to do that I need ...
1 vote
3 answers
724 views

Access shared data extension from child BU using SSJS

I am trying to access the value from a Data extension, using the below code. The code works fine if I pass the external key of the regular data extension. But when I pass the value of the shared data ...
0 votes
1 answer
1k 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
3 answers
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 ...
-1 votes
3 answers
91 views

Find associated BUs for a user in Marketing cloud

Is there an automated way to find out all the associated BUs for a user? Using SSJS or SOAP API or AMPscript?
5 votes
1 answer
2k 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 ...
2 votes
1 answer
109 views

Removing 1 billion rows of a DE

As the title suggests, I need to figure out how I can remove ~1 billion rows of a Send Log data extension. I can't even change the data retention policy until the count is < 100 million. I thought ...
0 votes
1 answer
52 views

ssjs System.Collections.Generic.Dictionary`2[System.String,System.Object]

I have a SSJS code that i am running SFMC cloudpages. The code is to do a HTTP.GET call to a url and then parse the JSON response.when trying to write out the result of parse i receive the following ...
0 votes
1 answer
45 views

Import lots of files from ftp to update datas extensions

I need to import 81 one different files daily, from a sftp, at a especific time, and overwrite the respectives data extensions. How do I do that without building 81 automations? How do I use ssjs to ...
-1 votes
1 answer
53 views

Convert epoch into datetime in CloudPage

I have a CloudPage JS Resource that I use to parse a JSON. As part of the JSON, a UTC timestamp in milliseconds is provided. I want to convert that into a DateTime and save it in a DE. I've tried ...
6 votes
1 answer
1k 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 ...
2 votes
1 answer
2k views

How to set charaset as UTF-8 in HTTP GET (SSJS) method in Salesforce Marketing cloud?

I am using HTTP get method to get the data from API,But the response returned from the API is not encoded in proper format.The Same response in Postman looks perfect. The content from Postman looks ...
0 votes
1 answer
1k views

SSJS perform data extract

Running this script but getting the error : - {"message":"Error executing perform call.","description":"ExactTarget.OMM.FunctionExecutionException: Error executing ...
0 votes
1 answer
1k views

How to retrieve a record from a data extension field in SFMC using SSJS

In my SSJS, I am using this approach to retrieve the value / record from a data extension field. Data extension name is Test_QResult Data extension field name from where i want to retrieve value is ...
1 vote
1 answer
2k 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 ...
0 votes
1 answer
89 views

Example of Filter Operator "Between" (SSJS)

I'm trying to use a complex filter in my WSproxy retrieve method that gets values where their date is between two dates. I'm this currently: var ThreeDaysAgoFilter = { LeftOperand:{ ...
0 votes
1 answer
1k 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\...
1 vote
0 answers
53 views

Does WSProxy have an Upsert Batch?

I'm looking at using WSProxy in my ssjs script to upsert multiple rows into a Data Extension. I know there's updateBatch for updating records and createBatch for inserting new records. However, I'm ...
0 votes
1 answer
2k views

SSJS replace function does not work?

Im trying to replace special character with null within SSJS. here is what i tried: <script runat="server"> Platform.Load("core","1.1.5"); var ...
0 votes
1 answer
84 views

How Do I Break Down a JSON Array Format CSV Column Into Individual Columns Within SFMC Data Extensions?

I have an interesting use-case where I am getting a Data Extension from CDP where one of the columns is in JSON Format. Now I want to break down the last column of this DE into its individual columns....
0 votes
0 answers
80 views

Auth API calls resulting in 400 bad requests when POSTing multipart/form-data payloads with SSJS

I'm trying to make Auth API calls to an external API Endpoint from Marketing Cloud using SSJS or AMPScript but I am getting 400 bad request errors for these calls. In talks with a contact from the ...
0 votes
1 answer
49 views

Salesforce Marketing Cloud SSJS: Unable to fetch the HttpRequest response

I am using the below SSJS code. var req = new Script.Util.HttpRequest(eventEndPoint); req.emptyContentHandling = 0; req.retries = 2; req.continueOnError = true; //req....
0 votes
1 answer
67 views

Performing File Transfer Activities using ssjs

i am currently trying to create and and start Activites in Automation Studio and i am stuck at performing File Transfer activities. i made sure to preform a series of Data Extracts so that the files ...
1 vote
2 answers
4k views

Update Salesforce object with a Script Activity

I would like to create a script activity in an automation to update a Salesforce Object. Here is my example script. How can i update I get it accepted as A SSJS script in the Script Activity? %%[ ...
0 votes
0 answers
58 views

Issue with adding / updating a record into a data extension via cloud page

I am trying to add / update a test record in a data extension from a cloud page but I keep getting 500 - Internal server error I have looked at the online resources and some answers here as well ...
4 votes
3 answers
2k 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
1 answer
976 views

Call to create the salesforceobject Campaign failed! Object reference not set to an instance of an object in Salesforce marketing cloud

I recieve the following error Call to create the salesforceobject Campaign failed! Object reference not set to an instance of an object When i try to execute the following code set @cost=...
1 vote
1 answer
1k views

How to Make API Call from SFMC Cloud page to External System

I'm trying to make API call to external system from a Cloud page, but when I publish I'm getting response Response:nullresultString:. Below the code details. Can someone please help me this. Thank you ...
0 votes
1 answer
53 views

Updating an Email Send Definition with SSJS to update data extension AND publication list

As part of an automated email we have, I made an SSJS script block to update an Email Send Definition (User-Initiated) to target a new data extension. However when we do this, it resets the ...
0 votes
1 answer
42 views

SSJS to update query definition - stringify individual column names with loop

We have a script activity in automation studio to update the text of a query definition and target a new data extension. It currently selects all fields using the standard SELECT *, but we need to now ...
3 votes
2 answers
4k views

Is it possible to retrieve the client IP address on a landing page?

I'm open to using SSJS or AMPscript to find the IP address of the client who is accessing a landing page. I tried this AMPscript: %%=HTTPRequestHeader("X-Forwarded-For")=%% Which resulted in a blank ...
1 vote
1 answer
82 views

Delete a subscriber off a Suppression list with SSJS

Given a suppression list, I am able to delete a subscriber from the list using SoapUI, I just pass the access token in the xml and I retrieve message 200 and the contact is deleted. However, when ...
-1 votes
1 answer
48 views

Converting Currency into USD using AMP script is not working

I tried to convert currency into USD, but instead of converting into USD it's moving to decimal place. My code is %%[ Var @num Set @num = formatcurrency("123.45678", "en-Us") ] %% ...
1 vote
4 answers
1k 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
1 answer
1k 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 ...
0 votes
1 answer
77 views

Can we Run An Automation for 24 Hours by adding repetitive activities to ensure we are processing data we captured in Data Extension

We need to continuously process data(need to make an API call using SSJS script activity to external system which is time sensitive) which we are capturing in Marketing Cloud Data Extension via SFMC ...
0 votes
1 answer
864 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
1 answer
63 views

Looping SSJS to output Ampscript variables partially works if I don't use a word building array function. Can't figure out why

I've got a data extension which has multiple rows for each item a user has in their cart and it's tied to their email address. The main issue is I need to cut off the product name at a max character ...
2 votes
1 answer
11k views

Trying to automate contact deletion with SSJS

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

Passing Data from Client-side JavaScript to SSJS in Salesforce Marketing Cloud

I'm trying to generate a QR code on a CloudPage in Salesforce Marketing Cloud using client-side JavaScript, then pass that QR code data to a SSJS script on the same CloudPage. The SSJS script is ...
0 votes
1 answer
142 views

Parsing data in the data extension with AMPscript

I have a data extension in Marketing Cloud with data about tasks per account per contact. A contact can be related to more than one account and can have multiple tasks in each account. I need to send ...
0 votes
1 answer
51 views

issue with UpsertDE "Unable to retrieve security descriptor for this frame"

I'm trying to write results in a Data Extension but this is the message response in the cloud page {"message":"Unable to retrieve security descriptor for this frame.","...
0 votes
1 answer
48 views

How to use a variable mapping a json

I need search the assets types in a json but mapping I have a block key that is different in all blocks. I set a variable that cointains this values but when I want to use do not retrive the things ...
0 votes
1 answer
72 views

How to execute journey exists in child BU from parent automation?

I need to execute a journey which is created in child BU from parent automation. The automation option is disabled in Schedule Type in the child journey even the data extension is used in the parent ...
0 votes
1 answer
2k views

Uploading image via Cloud Page form and then retrieving Content Builder image URL

I have created a Cloud Page with a form to upload an image using this tutorial: https://sfmarketing.cloud/2020/02/29/create-a-cloudpages-form-with-an-image-file-upload-option/. I am able to ...
0 votes
1 answer
75 views

SSJS to send data to API

I am trying to send data with SSJS to an API but am not finding the error. I always receive the 500 error when publishing the cloudpage to test it. <script runat="server"> Platform....

1
2 3 4 5
19