Hot answers tagged

5

You will need to convert the object to a string. Replace Write(res.Results.Sent); with Write(Stringify(res.Results)); to display the Results array. However, I see you would like to specifically retrieve the Sent value in Results. Note that Results returns an array of objects, so you would need to loop through each one and output the Sent value. The following ...


3

It is not technically possible to replace/update text content in an email after it has been sent. The examples shown e.g. here: How to refer Javascript cloud page in my email in content builder? and or here: Real time dynamic emails all rely on images, that are fetched at open. But the referencing URLs remain the same once the email has been generated and ...


2

You need to do the delete batch inside the while loop. You also need an array to house the objects that is emptied on each run. To allow you to have the full array as well as the delete array, I added a new var in for you. Something like below should work. Keep in mind, it is likely to choke out on significant volume due to the 30 min timeout of Script ...


2

1. SSJS Rows.Retrieve() loads 2500 rows at a time, and it looks like there is no option to limit the response size I would iterate from 0 to target.length to avoid IndexOutOfBoundsException But, in any way, this approach is not very effective 1.1 SSJS + _CustomObjectKey hack You can use _CustomObjectKey in the filter as an index surrogate In SOAP it looks ...


2

You can add a conditional statement in AMPscript: %%[IF NOT EMPTY(@imageUrls1) THEN]%% <table width="100%" cellspacing="0" cellpadding="0" role="presentation"> <tr><td align="center"> <img data-assetid="4855" src="%%=v(@imageUrls1)=%%" alt="" height="...


1

I think you are missing the closed } in your Rows.Update line before the first comma. https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/ssjs_dataExtensionRowsUpdate.htm This would be the "core" function. As an alternative you could also go for the "Platform" function which is ...


1

As per the Email marketing best practice, using JavaScript inside email is NOT recommended [infact not supported] which might lead to security issues. Also may mark your email as SPAM or PHISHING. Please read more here https://mailchimp.com/help/limitations-of-html-email/ But, it does NOT stop you from using Count down timer. There are many methods listed ...


1

as a general approach, insert something that tells you where the code ended up interpreting and run your code on a cloudpage, so you can see the result of write statements. See example below with the two Writes. /*....*/ if (Status == 2) { var obj = Platform.Function.CreateObject("Automation"); Platform.Function....


1

If I understand correctly, you are posting parameters to the form page itself. And upon reload of the page you want to prefill values which you have retrieved through RequestParameter(). In this case, you don't need a data extension lookup. You can just display the variable value in the html input element using value attribute in combination with using ...


1

I've spent some time trying to figure out why @David's script is errored even if the AMPScript code is validated on a CloudPage. Turns out it does work with Classic Content only (which already retired) and not with Content Builder. So, to save you some time, try this code instead: <script runat="server"> var stream = Platform.Function....


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