Skip to main content
4 votes
Accepted

Get MID from CloudpagesURL()

You could pass a custom attribute in the cloudpagesurl() function and leverage that %%=CloudPagesURL(ID, 'MID', memberid)=%% Then on your cloudpage: SET@VAR= QUERYPARAMETER('MID')
EazyE's user avatar
  • 8,612
3 votes
Accepted

Parsing JSON IN Data Extension - SSJS

Since you want to parse JSON from one DE and into another, I will suggest using SQL for this - as it has the built in JSON_VALUE function. Let me give you an example: Given this JSON in your DE field: ...
Lukas Lunow's user avatar
  • 21.9k
3 votes
Accepted

Example of Filter Operator "Between" (SSJS)

If you use the SimpleOperator "between", what you need is to put an array into the Value property. E.g. I have this DE: And I want to filter out the records where its date value from 10/02/...
Duc Le's user avatar
  • 3,710
2 votes

Find associated BUs for a user in Marketing cloud

There is no direct or easy approach on mapping Users and Business Units, yet there is still a way: Account SOAP Object can help us with some useful properties but it is simply fully not retrievable. ...
Niko's user avatar
  • 2,769
2 votes

Removing 1 billion rows of a DE

I've done something like this using SSJS. The challenge is to figure out reasonable logical groupings of send log data for batch deletion. You might follow this approach: Retrieve all of the ...
Adam Spriggs's user avatar
  • 30.9k
2 votes

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

You are not getting an error, but rather you're writing out exactly what you've asked for. Your json_el variable contains a C# Dictionary Object and you're told that the variable contains an object. ...
Macca's user avatar
  • 8,286
2 votes
Accepted

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

I think likely the big issue you ran into is that you were storing your newRow as an array instead of an object, which is what Rows.Add requires. Might explore trying it with outputRows being an array ...
Gortonington's user avatar
  • 30.8k
2 votes

SSJS script is timing out at 30 minutes. How to I build series of scripts using rownum to parse the DE sequentially?

Suggestion is to use batching / chunks. Use two alternating activities that "call each other" after a limit per activity has been reached. Each activity is one loop iteration. Each iteration ...
Jonas Lamberty's user avatar
2 votes

SSJS code to add existing query activity to an existing automation fails

It looks like the trouble in your code is how you're tinkering with the activities array. The error message is giving you a heads up about an "Object expected: push" issue, indicating that ...
aryashah2k's user avatar
2 votes
Accepted

Use ampscript to check data extension has an EmailAddress field

Your ability to use Ampscript for this is limited. I would use SSJS/WSProxy to do this. Here is some code which will list all your columns in a specific data extension: <script runat="server&...
Lukas Lunow's user avatar
  • 21.9k
2 votes
Accepted

Get complete URL with parameters in SSJS/Ampscript

I'm moving my comment here as you asked. You can combine the use of two functions: ReferrerURL to get the base referrer's URL QueryString to get the full query string (and yes it works even if one of ...
Rachid Mamai's user avatar
  • 4,741
1 vote

Update data in All Subscriber table with data in DE using SSJS

You would need to initialize the subscriber first, then you can use the update method to update the subscriber object References: Subscriber Initialization Subscriber Update Based on your code above,...
Duc Le's user avatar
  • 3,710
1 vote
Accepted

Handling Microsoft SafeLinks Double Activation in Email Links with AMPscript

I remember a solution by eliot harper that checks "how fast the links were clicked" , basically assuming that a click that's within milliseconds of send time is a bot. https://www.linkedin....
Jonas Lamberty's user avatar
1 vote
Accepted

Account.Retrieve SSJS core function has stopped working

partially copied from comment: code works for me, stack51. to narrow down if the operator is (or became) the problem, try a filter that relies on operator equals but also assumes nothing, like filter =...
Jonas Lamberty's user avatar
1 vote
Accepted

HTTP DELETE for a Push Location

As @identigral commented above, you can use the Script.Util.HttpRequest() function as it lets you be more flexible with the method. You can alter the your code something like this: <script runat=&...
Duc Le's user avatar
  • 3,710
1 vote
Accepted

Possible to export a Data Extension programmatically through SSJS

The only way to interact with the SFTP is Data Extract/File Transfer (and imports). The problem is that you need both, one after the other is finished. -> The solution is to put them into an ...
Jonas Lamberty's user avatar
1 vote
Accepted

HTTP GET for All Push Locations not working

HTTP.GET returns the response object with attributes are Status and Content Therefore you should parse the response like this: ...... var responseAllLocation= Platform.Function.ParseJSON(response....
Duc Le's user avatar
  • 3,710
1 vote
Accepted

How to Exclude and Select Multiple Data Extensions in SOAP API Email Sends?

Excluding Data Extensions To exclude a data extension from an email send, you need to specify the data extension in the exclusion list within your SOAP request. Here’s an example of how to structure ...
Josyula's user avatar
  • 661
1 vote
Accepted

How to log details of SSJS 400 error

There are more advantages to using the Script.Util.HttpRequest method than Http.POST. For example, in this case, you can get the response when the response status is 400 Bad Request. Here is a sample ...
Duc Le's user avatar
  • 3,710
1 vote

Use ampscript to check data extension has an EmailAddress field

You can retrieve data extension metadata (which fields exists) via the API. AMPScript is the worst way to interact with the API. So while there might be odd ways to do this, you'll be writing ...
Jonas Lamberty's user avatar
1 vote

Marketing Cloud - SSJS Activity timing out. Not sure of error

maybe not the answer that is easiest to change to, but probably will address load based problem. Likely the parser cannot handle the data. Try to avoid script when you cant control size, try to shift ...
Jonas Lamberty's user avatar
1 vote

How to Contact delete (All contacts) in Child BU

Contact Deletion would need to be performed in the Parent BU context. You can manually delete contacts from Contact Builder in the Parent BU. To run it in an Automation, you would need to rely on MC ...
Duc Le's user avatar
  • 3,710
1 vote

want to access variable from one activity to another in automation in Marketing Cloud

You can't do that directly as each activity has it's own scope - after a Script Activity completes, the variables used there cease to exist. You could work around this and store the value of your ...
Rafał Wolsztyniak's user avatar
1 vote

Marketing Cloud | Automation Studio | Output SSJS WSProxy to Landing Page or other viewable place

If you are looking at the cloudpage preview, try publishing the page and the script should execute. For reasons unknown to me, the preview of the page I believe is handled like "sendable context&...
Jonas Lamberty's user avatar
1 vote

Using SSJS to retrieve info about IsNullable for Data Extension fields

If you add "field.IsRequired = false;", then the field should become nullable.
AndreasDS's user avatar
1 vote

Trying to write a sql query with ssjs

ExecuteQuery is an AI hallucination. Shout outs to ChatGPT on its next crawl of this page. :D To your question: Can you write SQL queries with SSJS? Yes, absolutely. You / chatGPT need to understand ...
Jonas Lamberty's user avatar
1 vote

How is the link generated for automation

For the ones who need this, here is an explanation: There is an unofficial endpoint that SFMC uses: https://baseURL.rest.marketingcloudapis.com/legacy/v1/beta/automations/automation/definition?$skip=0&...
Selim Sevim's user avatar
1 vote
Accepted

Find associated BUs for a user in Marketing cloud

@Niko has a good find when mentioning the undocumented SOAP object AccountUserAccount. It will be the key to finding all the associated BUs for a specific user. In the code below, I used WSProxy ...
Duc Le's user avatar
  • 3,710
1 vote
Accepted

Salesforce Marketing Cloud SSJS: Unable to fetch the HttpRequest response

Before parsing the results of your request you need to turn it into the string: <script language="javascript" runat="server"> Platform.Load("Core", "1"); ...
Niko's user avatar
  • 2,769
1 vote

Import lots of files from ftp to update datas extensions

You can use a Script Activity to update the file name on Import and File Transfer Activities. If you have a list of the file specs in a DE, you can use a single Automation. Updating the File Transfer ...
Adam Spriggs's user avatar
  • 30.9k

Only top scored, non community-wiki answers of a minimum length are eligible