New answers tagged

1

I wrote an article on a similar situation here. The main difference being my article was about an inventory of DE for your whole BU and included many different values and properties that may be unnecessary for you. I would use this function: function getAllDeInfo(mid) { var prox = new Script.Util.WSProxy(); prox.setClientId({ "ID": mid }); //...


1

The post you mentioned above will return JSON which will contain all the DE Information. To store that DE Information, whichever field you would want to save in your Target DE, you need to create one. For Instance, I created a DE 'DEDetails', with the below configuration A sample JSON from the 'retrieve' function would be something like this: { "Name&...


2

I did the following and was able to get the shortUrl: var result = HTTP.Post(url, contentType, Stringify(payload), headerNames, headerValues); var resultStringified = Stringify(result) var obj = Platform.Function.ParseJSON(resultStringified); var objResp = Platform.Function.ParseJSON(obj.Response[0]); var shortUrl = objResp.shortUrl; Write(...


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 ...


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="...


0

I was dealing with the same issue, it does not seem to work with the standard AMPscript code block tags %%[]%% but when you change these to <script language="ampscript" runat="server"> instead it works. So in your case it would look like this: <script language="javascript" runat="server"> ...


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 ...


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 ...


0

Perhaps Denis's answer would be the normal route for a Marketing Cloud developer, so please check that out. I was hoping there was a simple filter option, but I was able to figure out a different solution by generating batch numbers on the load from the SQL statement. I'm much more comfortable with SQL than I am with JavaScript and AMPScript, so the old ...


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 ...


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....


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....


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 ...


0

Unfortunately a good majority of Core functions cannot be used in a messaging context and only in Landing pages and Script Activities. I will be honest, this is only very lightly documented and is not in anywhere very obvious. For example: Now even this is pretty ambiguous on meaning. It could easily be interpreted to just mean that you should use ...


0

There is an API method for retrieving Cloudpages using Content Builder API. Unfortunately this does neither show the PublishedURL, nor does it respect Cloudpages built with Classic Editor. You can use this with POSTMan to check for yourself. The result does NOT contain the publishedURL. It does contain the PageID. GET {{restEndpoint}}/asset/v1/content/assets?...


Top 50 recent answers are included