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
1 answer
47 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....
aryashah2k's user avatar
0 votes
0 answers
57 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 ...
Chris G's user avatar
0 votes
1 answer
39 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....
Ranjan's user avatar
  • 67
0 votes
1 answer
28 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 ...
Leon's user avatar
  • 3
0 votes
0 answers
54 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 ...
kuml2's user avatar
  • 303
-2 votes
0 answers
39 views

Downloading PDF file from byte array in SSJS

I am trying to convert byte array to PDF file in ssjs. I am trying below javascript code to do it. However, it doesnt seems to be working in SSJS. var blob=new Blob([resultByte], {type: "...
nikhil's user avatar
  • 7
0 votes
1 answer
31 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 ...
TCassa's user avatar
  • 824
0 votes
1 answer
36 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 ...
TCassa's user avatar
  • 824
1 vote
1 answer
65 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 ...
Johhnytska's user avatar
-1 votes
1 answer
30 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") ] %% ...
SFMC Developer's user avatar
0 votes
1 answer
64 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 ...
JNC's user avatar
  • 39
0 votes
1 answer
55 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 ...
Erik B's user avatar
  • 63
0 votes
0 answers
94 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 ...
QazWsx's user avatar
  • 3
0 votes
1 answer
124 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 ...
Julia's user avatar
  • 3
0 votes
1 answer
35 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.","...
Juan's user avatar
  • 1
0 votes
1 answer
43 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 ...
Juan's user avatar
  • 1
0 votes
1 answer
54 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 ...
Prasad Ruwanpathirana's user avatar
0 votes
1 answer
54 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....
Sebastian Hansen's user avatar
1 vote
1 answer
219 views

Why is my SSJS if else if else function not working?

I have an attribute field called "klantnaam". In another field called "adressen" I have a JSON array with several objects. In the object I have the following fields: adressoort, ...
Martijn e's user avatar
  • 145
0 votes
1 answer
98 views

Error Message: "Unable to retrieve security descriptor for this frame." - Get JSON Data using SSJS in SFMC

I've just started to get my head round SSJS and tried this simple script from a tutorial as the script I wrote (same logic) was erroring in the same way. I am looking to upsert data into a DE from a ...
Eddie Belhay's user avatar
0 votes
0 answers
263 views

How to insert a row in a Data Extension using SSJS?

I'm trying to add a row in a Data Extension using the following code: <script runat="server"> Platform.Load("Core","1"); try { var deRows = {offer_id:&...
Leonardo's user avatar
-1 votes
1 answer
104 views

SFMC - Automation SSJS Get filename and other metadata

Currently, I have a file transfer and file import activity in my Automation. As part of this automation, I need to get the file name and number of records in the file for Audit purpose. Based on my ...
user133411's user avatar
1 vote
2 answers
75 views

Is there a way to store a random number for using in the subjectline and HTML body?

I am using the script and modified it to my needs: %%[ /*Sets de AB */ set @modtarget = AttributeValue("_customObjectKey") if not empty(@modtarget) then if mod(@modtarget, 2) == 0 ...
Martijn e's user avatar
  • 145
0 votes
1 answer
75 views

How SSJS Script Can Be Execute Multiple times

I have a use case where I need to make a REST API call to the third-party application to get coupons. I was able to make API call and capture coupons into DE, but due to API limitations, I'm only able ...
Harish 's user avatar
  • 111
0 votes
1 answer
48 views

Unable to update a second column value in data extension using wsproxy

I want to pull a data extension DE1 where it has two columns I used wsproxy to copy these column values to another data extension where one of the two column is encrypted and another column needs to ...
Prash's user avatar
  • 1
0 votes
0 answers
60 views

API call getting 422 when pulling JSON payload from Data Extension

I am trying to pull a JSON payload that exists as a value in a field in a data extension into an API call. When I try this I am getting a 422 response. I have tried writing the value of the DE field ...
BenL's user avatar
  • 1
0 votes
1 answer
176 views

I want to search the list of SQL Query Activities which uses my target data extension in Select statements without explicitly storing them in DEs

I'm trying to display the results in the form instead of storing the details in data extension which makes it accessible for everyone with the cloudpage URL. Here the search is not happening as ...
vis_1019's user avatar
0 votes
0 answers
55 views

Writing 100k deletes SSJS in DE and applied filter to column SCD_FLG and value D. Below code got failed in automation. Any leads will be appreciated

<script runat="server"> Platform.Load("core", "1.1.1"); var config = { name: "91D16891-FEEC-4C5C-A6E9-729D7E612B5A", cols: ["OFFER_DK"]...
user132577's user avatar
0 votes
1 answer
84 views

Error trying to retrieve Automations and inserting them into a Data Extension using SSJS

I am trying retrieve all Automations from a Business Unit and insert them in a Data Extension ussing SSJS. It works fine when I retrieve them in a Cloud Page but when I try to insert them into a Data ...
pmleal07's user avatar
0 votes
0 answers
58 views

Creating a Data Extension from a data schema via SSJS

I am trying to create a page where I can paste a data schema and it will create a data extension rather than doing it all by hand. Here is what I have so far but its not working. Please advise. EDIT: ...
QazWsx's user avatar
  • 3
0 votes
0 answers
95 views

API Triggered SMS to a Data Extension

I'm trying to find a way to trigger SMS using SSJS Script Activity in the Automation Studio. The records are in the Sendable DE - is it technically possible to trigger SMS within SFMC, using API call ...
Lana K.'s user avatar
0 votes
1 answer
39 views

SSJS retrieve working but not getting all rows

I am trying to move records from a DE into a custom object using an SSJS core function script (adapted from one I found here). I have it working, but it leaves some records behind. Get's about 820 out ...
Sean Carew's user avatar
0 votes
0 answers
35 views

SSJS - Error API - SSRF detected

When trying to push a request to a specific endpoint (in a kafka topic exactly). Support team tell me to check for whitelisting SFMC Ip Addresses, it was already done. This same Request works in ...
Mahmoud Gueye's user avatar
0 votes
0 answers
99 views

Is there a way to run SSJS as async?

We need to make thousands of API calls to 3rd party server. I was planning to do so using script activity in the automation studio. But, since SSJS and AMPScript are synchronous this can take hours ...
yoni349's user avatar
  • 81
0 votes
1 answer
92 views

Encrypt fields subscriberkey and email address in the url using a key to send a cloud page in ssjs/amp script

I have 2 cloud pages and I'm navigating from 1st to 2nd (where I'm doing some additional processing). Now the problem is that my 2nd cloud page needs field values from page1 which is subscriberkey and ...
Jimmy Vaswani's user avatar
0 votes
0 answers
15 views

Can I run a query activity from a cloudpage? [duplicate]

is it possible to run a query activity from a cloudpage? And how can I achieve this?
Martijn e's user avatar
  • 145
-2 votes
1 answer
131 views

Create an survey where the pages in the survey will be navigated based on the response in previous page [closed]

I am new to MC and I am given the task to create a survey where the questions will be posted to the end-user. The questions in the survey should get navigated based on the response in the previous ...
Rahul Allada's user avatar
0 votes
1 answer
57 views

Create a list of Data Extensions that are being used in Filter Activities in Marketing Cloud

I need to create a list of Data Extensions being used in the Filter Activities in Salesforce Marketing Cloud. I tried using the FilterDefinition but I am not getting any results. I am using the ...
pmleal07's user avatar
0 votes
1 answer
229 views

Protecting Cloud Page with Login Form (SSJS)

I am looking to protect a cloud page with a login page. i have written this SSJS for the page to be secured: <html> <head> <script runat="server"> Platform.Load("...
QazWsx's user avatar
  • 3
0 votes
0 answers
55 views

Custom pref center using WSProxy

I just start learning WSProxy and I'm trying to build custom preference center in SFMC for multiple publication lists so I started with 2 test publication lists test1, test2. I use if else statement ...
Mohammad's user avatar
1 vote
1 answer
94 views

Create list of Data Extensions that are being used in Data Extension Extracts in Marketing Cloud

I need to create a list of Data Extensions being used in the Data Extension Extract Activities. I tried using the ExtractDefintion but I haven't managed to make it work. https://developer.salesforce....
pmleal07's user avatar
1 vote
1 answer
89 views

it is possible to process ampscript SSJS

Can I process an SSJS AMPscript? If I receive a string "AMPscript" can I give it a context and SSJS will process it? in the provided code I am trying to take a string like this %%=FormatDate(...
SpinXO's user avatar
  • 25
0 votes
2 answers
300 views

delete subscriber from Auto Suppression List using SSJS?

SSJS to delete record from list runs, but no action I am getting similar error however in my case i am trying to delete the email from Auto supression list created in Email Studio Admin page. <...
syed Basha's user avatar
-2 votes
1 answer
264 views

Pass a variable from Javascript to AMP Script or SSJS

Is it possible to pass a variable from Javascript to AMP Script or SSJS? The reason is I need to use Javascript libraries to generate a variable which I need to use in SSJS to make an API call.
Helios.One's user avatar
0 votes
1 answer
199 views

How to batch update DE records using WSProxy?

I was able to update 1 record at a time using this code: var prox = new Script.Util.WSProxy(); var props = [ { "Name": "Contact_Key", "Value&...
yoni349's user avatar
  • 81
0 votes
0 answers
129 views

Not able to retrieve null values from nested JSON array using SSJS For loop

Here's the nested json I'm working with { "Instructions":{ "Instruction":[ { "Type 1":"abc", "Type 2":"...
zahaan's user avatar
  • 1
0 votes
1 answer
69 views

Programatically update the "Used for Sending" value for DEs in folder and all child folders

I'm attempting to update the "Used for sending" value for all DEs in a select folder and include the DEs in all the child folders. I've written the code below that passes valideation, but I ...
Gbengoose Wuru's user avatar
0 votes
1 answer
96 views

Remove duplicates from an array built in SSJS

I'm using SSJS to pull api data and build emails. I have an array built that has some duplicate data in it. I'm looking for anyway to remove the duplicate information. I've tried all the regular JS ...
Jason G's user avatar
1 vote
0 answers
38 views

SFMC - upload contents (as a formatted JSON) to sftp

Let's say we've got <input type="file"> inside a form placed on a cloudpage and posted it using POST with our file contents as a form params to a server side. Is it possible to send ...
pincet's user avatar
  • 807
0 votes
0 answers
79 views

SFMC Lookup is not working after Upsert Data Extension

I am using (SSJS +Ampscript) because i need to create dynamic variables. I am upserting DE using ampscript and trying to look up same record using SSJS Rows.Lookup but still giving the old value not ...
user2733262's user avatar

1
2 3 4 5
19