All Questions
73 questions
0
votes
1
answer
62
views
JS Code in Browser AND Server
Is there any practical way to write JavaScript functions such that the same code can be executed in BOTH a Landing Page written in AMPscript AND SSJS executed on the server (other than copying the ...
0
votes
1
answer
403
views
Retrieve with ws proxy with filter using DateValue does not work
Hello dear sfmc people,
using date field in filter does not work as it's stated in the documentation
https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/simplefilterpart.html
I have ...
0
votes
1
answer
58
views
smart Capture does not work with iphone
I have a smarcapture that I added this code snippet to pass by url a parameter of a question and it works in android and pc but it does not capture the IOS information.
const form = document....
1
vote
1
answer
189
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
1
answer
150
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 ...
-2
votes
1
answer
1k
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.
0
votes
0
answers
167
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":"...
0
votes
1
answer
86
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 ...
0
votes
1
answer
251
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 ...
0
votes
1
answer
77
views
How to update Data Extention row without creating a new record
i am very new for marketing cloud and I am having this problem.I have a Data Extention containig a list of Subscribers with their email and subscriber key.I build a form working well, which can post ...
-1
votes
1
answer
471
views
Using UpdateSingleSalesforceObject for multiple records
I've got a Cloudpage with Ampscript that displays record information of a custom object related to a Contact. It displays a particular field as a checkbox, which corresponds with the custom object ...
0
votes
1
answer
208
views
Using MC Data Extension to update HTML on Landing Page [closed]
Is it possible to pass HTML code through a Data Extension value to set the HTML for an AmpScript Landing Page?
0
votes
1
answer
640
views
UpsertDE function not working on Shared Data Extension using SSJS from child BU even though used ENT
I want to use UpsertDE function on Shared Data Extension using SSJS from child BU. Even I tried ENT. before DE name, I have received 500 error in cloud page and script activity is getting errored in ...
1
vote
0
answers
303
views
Fetch form values from localStorage to SSJS script
I am trying to resolve an issue of a scenario in which two cloud pages are created, for example, Page A contains a form with multiple fields, while Page B contains SSJS code to send the data to the ...
1
vote
1
answer
152
views
ERROR "Unable to retrieve security descriptor for this frame." When using WSPROXY's createitem with JSON object any tips?
So, I've been testing some use cases with SSJS and got into this error "Unable to retrieve security descriptor for this frame." which occurs with the
apiAudiencia.createItem("...
0
votes
1
answer
1k
views
How to configure a cloud page to be inaccessible to public in SFMC
Currently, I have built a cloud page in SFMC that is being used for custom report.
Goal is to make it private / inaccessible to public so only SFMC users can access it.
Out of scope options:
Private ...
0
votes
1
answer
731
views
how to use SSJS to extract all distinct values (may require looping) and push it to sql query in marketing cloud?
I am new to SSJS and have not used it yet.
I have a use case where I need to extract JobID and Data Extention Name from SendLog Data Extension.
I use JobID and DE_Name in SQL query but right now I ...
0
votes
1
answer
366
views
Why does my publication list array return undefined in Vuejs?
I'm learning to build a custom preference centre and trying to display all the lists for a subscriber. I retrieved all the lists like below:
<script runat='server' type="text/javascript"&...
0
votes
1
answer
694
views
Can I trigger a specific step of automation I want to start ? Using SSJS
I have this code that Start my automation, but I also would like to say what of steps start and finish
Like : I just want that step 3 start and finish
Follow the code:
<script runat="server&...
0
votes
0
answers
71
views
I'm having problems with inserting subscribers in my DE
I want to insert data in my DE, but instead of inserting each subscriber inside a line, it's putting all the text on my page on one line, how do I fix this?
The Subscribers that I retrieve in my web ...
0
votes
0
answers
155
views
ClaimRow in SSJS does not work
I have wrapped AMP script function ClaimRow in to the SSJS it works and changes the boolean field to true but when I do lookup rows this change is not visible.. I had issue in the past and that is why ...
0
votes
1
answer
1k
views
How to fetch a variable declared in ssjs script into client side script
I am storing the value of lookup function into a variable say " var temp;"
In ssjs script.
I want to fetch this variable in client side script.
I am using
Console.log(<ctrl:var name=temp /...
0
votes
1
answer
316
views
Save API Call Response
I need to create a job that monitors the delete jobs that are running in our BU every day. I managed to use this API (https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/...
0
votes
0
answers
105
views
Script activity not pausing and deleting the TS
I am trying to Pause and Delete the Triggered sends present in out account which were created/used before 3 years. Below code works fine in a CloudPage but does not perform any action when using it in ...
0
votes
1
answer
795
views
Marketing cloud page insert row using onclick event
I have this image
<img src="%%=v(@link)=%%" onclick="registerClick()">
and the following function
function registerClick(){
alert('click');
%%[ outputline('OUTPUT') ]%%...
1
vote
0
answers
425
views
Error from Rows.Add
I have the following script that returns the array as expected. When I go to add the "Rows.Add" aspect, I get a 500 error. I am testing the script on a cloudpage with plans to move it to an ...
1
vote
1
answer
571
views
Pass value from Ampscript to SSJS Sleep function
I have ampscript value which defines how many milliseconds the function should delay the process but can I pass that 'ms' value from ampscript to sleep(?). Below is my script
%%[
var @ms
set @ms="...
0
votes
0
answers
401
views
Script Activity in Marketing Cloud
I've some problem when I use the WSProxy in Script Activity. My goal is to search in all the non-sendable data extension if there is a column called "ID" and in the case it's exist I want to ...
0
votes
2
answers
1k
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 ...
1
vote
0
answers
691
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 ...
1
vote
1
answer
118
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
1
answer
1k
views
Overwrite Rows in Data Extension using Script Activity and SSJS
I've been working for about two years within Salesforce Marketing Cloud, but haven't had the need to utilize anything outside of AMPScript, HTML, and CSS as I mostly just build and deploy emails with ...
0
votes
1
answer
561
views
SSJS DataExtension.Add Syntax for Decimal Fields
I need to create a data extension using javascript that includes DECIMAL fields.
Here's my code that wasn't working.
var deObj = {
"CustomerKey" : "Genesis_DE",
&...
1
vote
1
answer
471
views
SSJS redirecting to wrong page
I have a processing cloud page and the page redirects correctly to success page but when I add in extra bit of code for error page redirect, records evaluating success still goes to the error page. Am ...
0
votes
1
answer
3k
views
Reference SSJS Code Resource in your Landing Page
I've been trying to insert/reference an SSJS code resource in my landing page but using the CloudPagesURL(123) function doesn't seem to work? I've been using the function when referencing javascript ...
0
votes
1
answer
521
views
Is it possible to execute ampscript or ssjs onchange via checkbox check/uncheck
As I wrote in the question title I was just wondering if a block of ampscript & ssjs combined code can be execute on change via checkbox check/uncheck?
<input name="TopicID" type=&...
1
vote
1
answer
4k
views
SSJS Split String
How to use split function in SSJS to split String?
In my case, I have given the String and , the way I want to split is as follows :
My String : I want 2 splits
dfc_1 : dfc_ and 1
dfc_45932 : dfc_ ...
1
vote
0
answers
818
views
Script Activity Outputs
I creasted a SSJS in Marketing Cloud under --> Automation Studio --> Activities --> Script , I was curious to know how I can view the results of Write statements in the script?
I am able to store data ...
1
vote
1
answer
748
views
Send personalized SMS in Marketing Cloud with javascript
We need to send a personalized SMS to a group of contacts. We made a working block of code that does that, but we call the server for each SMS like this:
var sendSMSResult = HTTP.Post(sendSMSEndpoint,...
0
votes
1
answer
1k
views
SSJS script to update query and start automation with 3 minute wait in between each loop iteration
I have a script that have nested loops that loop through some arrays. In those loops, I have a something that updates a SQL Query Activity, then something to start an automation.
What I am trying to ...
-11
votes
3
answers
3k
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(...
0
votes
1
answer
1k
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
1
answer
2k
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 ...
0
votes
1
answer
1k
views
How to overcome 2500 SSJS limit to delete more than 2500 DE records at once?
I created a SSJS script to delete certain records from a DE which seems to work fine for less than 2500 records. But once the number of records that need to be deleted surpass 2500 records, then it ...
1
vote
2
answers
2k
views
Trying to trigger an automation from different Business unit using SSJS Activity
I have written the below code and created one test scheduled automation to start the automation. I didn't get any error when i did scheduled/publish the code but my automation is not starting. and i ...
1
vote
0
answers
658
views
SSJS script activity not updating Query Definition as expected
I am trying to update a query definition in Marketing cloud using SSJS script which updates the query based on the datestamp. When I run the script, I don't get any error but it does not seem to be ...
1
vote
1
answer
3k
views
How to access client side javascript variable in SSJS?
I am facing difficulties in showing a message. Below is the problem statement :
I have six textboxes on a cloud page which stores six digit coupon code(one digit each). I am trying to show a error ...
1
vote
0
answers
826
views
SSJS - Read a Data Extension after an Rows.Update
i'm now in my firsts baby steps in JavaScript on Salesforce Marketing Cloud.
In my script i read one Data Extension with an DataExtension.Init("DE") and a DE.Rows.Retrieve(filter).
After this, some ...
1
vote
2
answers
1k
views
JSON call using SSJS to populate a dropdown list in HTML and pass it through using AMP
I have a JSON object full of County names and I want to call it using SSJS then populate a dropdown list in HTML using the Data from the JSON.
JSON looks like this
[
"AZ - Maricopa",
"AZ - ...
0
votes
1
answer
1k
views
How do I sort a rowset with Server Side Javascript linked with AmpScript?
I'm using AmpScript to make a custom email and I need to sort rows to display them in order of date. I saw that I can use Server Side Javascript to make this, but my variable in ampscript is a rowset, ...