All Questions
Tagged with marketing-cloud javascript
61 questions with no upvoted or accepted answers
3
votes
0
answers
344
views
Using Zapier Activity within Journey Builder
I´m triying to create a Zapier's custom activity within Journey Builder, but I´m having problems to show it in SFMC, pulling me the followin error: "One or more custom activities failed to load. ...
3
votes
0
answers
3k
views
Adding SSJS Script Activity to ExactTarget Automation Studio
we need to do the following and I'm rather lost of where to begin, so I was hoping someone could point me in the right direction.
We need to create an SSJS Script Activity to Automation Studio (this ...
2
votes
0
answers
835
views
Importing CSS & JS into portfolio and referencing them
I need to build email templates and have already been provided with the source code. I have encountered 2 issues:
When I try to reference the CSS I have uploaded in the portfolio, SFMC doesnt seem to ...
1
vote
0
answers
182
views
MCP (Personalization) SDK / sitemap which namespace to use and how to configure sitemap for multiple domains
In MCP (Personalization) SDK / sitemap, when we are reviewing the namespace, examples are supporting both: SalesforceInteractions & Evergage
https://developer.salesforce.com/docs/marketing/...
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("...
1
vote
0
answers
112
views
Duplicate API Calls on HTTPPost
We have added an API call to one of our emails, when activated in journey builder we are seeing the same contact hit the same API twice, sometimes three times ~85% of the time. Here is the JS we are ...
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
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
0
answers
448
views
Post custom HANDLER URL reCAPTCHA
I am trying to implement reCAPTCHA validation via Marketing Cloud - cloud page.
I have used this guide to do that: https://ampscript.xyz/how-tos/how-to-implement-google-recaptcha-on-marketing-cloud-...
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
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
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
0
answers
458
views
smart capture javascript validation
I tried to do validation using Javascript on smart capture.
When I submit the form it does not seem that the function is running.
My code:
Form tag:
<form id="myId" class="smartcapture-content-...
1
vote
0
answers
413
views
Marketing Cloud SmartCapture javascript validation
I am trying to add field validation with Javascript on a SmartCapture form. The field validation is working, however I get POST 500 (Internal Server Error). For some reason, the post method breaks ...
1
vote
0
answers
316
views
Customizing Marketing Cloud Homepage UI to have message box pop-up when a user logs in - possible?
Is it possible to display a pop-up window or a message box, containing text and buttons to agree and disagree to the message, when a user signs into an account and loads the Marketing Cloud homepage?
...
1
vote
0
answers
481
views
Server side Javascript in Marketing Cloud not updating data correctly
I am trying to update data in a data extension using a SSJS activity in automation studio. I've debugged the code in a browser and everything seems to be working correctly but when I run the activity, ...
1
vote
0
answers
150
views
Variables won't pass from server-side javascript onto Microsite
I'm trying to get variables on a microsite to pass from the form page to the thank you page. Passing the variables works, and loading them into a data extension, but getting them to also display ...
1
vote
0
answers
766
views
SetUserInfo for Collect Tracking Code from subscriber level data pulled from appended URL
I am attempting to define the user info inside the js needed to SetUserInfo for the Collect Tracking Code implementation.
<script type="text/javascript">
_etmc.push(["setOrgId", "MID"]);
_etmc....
1
vote
0
answers
209
views
Can Javascript Activity be used to add/update All Subscribers List?
Can Javascript Activity be used to add to the All Subscribers List at the Enterprise Business Unit and update All Subscribers List at the Child Business Unit?
I was able to achieve this by creating ...
1
vote
0
answers
855
views
Upload images to portfolio using Server Side JavaScript
I have a simple html file upload page, an example snippet of the code below.
<html>
<body>
<form action="<ExactTarget page with ssjs file handling>" method="post" ...
1
vote
1
answer
204
views
Simple javascript lead delivery in to an Exact Target list?
I have a client who I've given both the web collect and the API methods of delivery as options to implement on their website lead forms so we can automate their emails. They have an issue with the ...
0
votes
0
answers
82
views
Javascript variable not being passed to ampscript when using Save button. The form should not be submitted
<form>
<input id="firstName" name="firstName" type="text" placeholder="First Name">
<input id="lastName" name="lastName" type=...
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 ...
0
votes
0
answers
270
views
How to check if a today's date is between two dates using AMPScript in SFMC?
Background: On a cloud page in SFMC, I am trying to display a message if today's date is between start and end dates that are coming from data extension.
Question: How can I perform a check and see if ...
0
votes
1
answer
202
views
help with UpdateSingleSalesforceObject with server-side Javascript script
I want to perform data updates based on data that is in a DE, if the Contact_Id of the case is the same as what is in the DE then perform the modifications that are in the variables
but when I run the ...
0
votes
1
answer
91
views
Unsub and Submit the data in Marketing cloud Data Extension
When someone clicks on the email unsub URL, it will be redirected to the cloud page, and on CP, there are reasons for unsub using the check box. I want to perform two actions on a single button:
Save ...
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
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
0
answers
232
views
Retrieve AccountUser List Using WS Proxy and returns no rows Found
Help, I'm new to using WS Proxy.
I'm trying to retrieve Inactive users but throws me no rows found.
Here's the code I used.
<script runat="server">
Platform.Load("Core", &...
0
votes
0
answers
133
views
Pass AMPScript variable to client-side Javascript code in separate JS file
As above mentioned in the title, I'm trying to pass an AMPScript variable, which is a value coming from a data extension. The AMPScript block remains in the HTML code.
On the other hand, I have a ...
0
votes
0
answers
385
views
Salesforce Marketing Cloud - Use OnChange with AMP Script in Cloudpage
I have a problem since yesterday. I want to build a cloudpage which is use to save some informations filled by the customer. I need 2 dropdown list, which the options of the second one, depends on the ...
0
votes
0
answers
294
views
CloudPage redirect to landing page not working - Error 500
I need some help with creating a Cloud Page that need to redirect customers to a landing page. When the customer land on the page this should be counted as action and trigger a 'Wait Until API Event' ...
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
5k
views
How to use Next JS to send POST requests to Salesforce Marketing Cloud API
The problem
I'm building a site on Next.JS to collect emails and I need to send the emails to a Salesforce Marketing Cloud data extension via the API.
I first need to request an SFMC token then send ...
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
164
views
I want to retrieve all the publications lists that it's inside of a folder
I have this code that retrieve all publications lists (Id and Name) from marketing cloud
I would like to retrieve just publications lists that it's inside of my folder called "Morning Message&...
0
votes
0
answers
117
views
I want to retrieve records from a List and update a DE, what's wrong with my code?
I tried retrieve the records from my list and then try "updateitem" with Data Extension inside
but it's not working
<script runat="server">
Platform.Load("core&...
0
votes
2
answers
214
views
Einstein Streaming Updates through API not working
I know there is another question out there similar to mine. When I make the Postman call, I receive a 401 error (unauthorized). I've checked the API_Key. Is this related to the whitelisting ...
0
votes
0
answers
2k
views
Adding css/js code resources into a Marketing Cloud Landing Page (Preference Center)
I want to start by saying I am very new to html, css, and js. So this may seem like a stupid questions.
After I upload my CSS file upload into Marketing Cloud using the code resource, I have added the ...
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
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
588
views
How to encrypt sent data using the XMLHttpRequest and retrieve it via AMPscript?
Our client is looking for a preference center where there is no page refreshing, the user click on submit and a message pops up
I did not do this before, so I made an example to achive this, with a ...
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
0
answers
302
views
how to redirect to a Marketing cloud profile center by making a custom link
I want to create a cloud page which needs to be hosted in the Wordpress, the cloud page will take their input as email and when clicked on the submit button it should redirect to their Marketing cloud ...
0
votes
0
answers
61
views
Issue with a script running to lookuprows and loop through the lookup until all rows with the same ContactId have been combined into one row
I am running the following script to lookuprows in a data extension and combine multiple rows with the same contactID into one row - but at the same time taking one column (PH_Name) from the separate ...
0
votes
0
answers
306
views
Custom Journey Activity - Get data extension field names
We have built a custom journey activity - we need to display the fields of a data extension in the UI. When the load the UI in the journey builder we request the requesttoken event and the marketing ...
0
votes
0
answers
215
views
How to get html form input hidden value which is rendered from Javascript on click function to lookup DE and pre populate form selections
I have a cloud page A that has Javascript and another cloud page B which has HTML, AMPscript and the cloud page A is called in cloud page B as src (<script src ="%%=Cloud Page B's URL=%%"&...
0
votes
0
answers
194
views
How to retrieve the folder ID of a shared folder with server-side java Script
Having the folder name, when I try to get the folder ID of a local folder, my server-side java script code works well; but when the folder is a shared folder is not working.
Could you please advise ...
0
votes
1
answer
522
views
encode in md5 a field of a form in cloudpage
I have a form on cloudpages, my question is if it is possible to be able to encode one of the fields in md5, to send it to the DE as subscriberkey.
I have tried javascript but I have problems because ...