1

I am building a setup to trigger an automation from the cloud page by following this guide - https://ampscript.xyz/how-tos/how-to-start-status-of-automation-from-marketingcloud-form/

When I try to add the code for form-handler by creating a new Code Resource (Javascript) and then save or publish in Cloudpages, the code completely disappears and becomes blank. Tried creating a new file and same is happening

Could anyone help me how to fix this issue and make this work?

1 Answer 1

3

This could be related to the recent issue described here: https://trailblazer.salesforce.com/issues_view?id=a1p4V000000pbKRQAY

Problem:

When saving a code resource with a script tag that uses single quotes around 'runat=server' the Content Builder sanitizer will strip the entire tag block. Example:

<script runat='server' language='javascript'>
// this is a script
</script>

Solution:

Double quotes work fine, example:

<script runat="server" language="javascript">
// this is a script
</script>
3
  • 2
    That is garbage! How would it handle no quotes, eg <script runat=server> does that blow up everything too? Sorry, I know its not your fault @LukasLunow - just venting as that is a huge issue and huge impact that seems to be brushed under the rug. Mar 4, 2022 at 16:29
  • 1
    Thanks for chipping in, @Gortonington - TBH I have not been able to validate this, and did initially only shared the snippet from the known issue page. Apologies for blindly ignoring the "no quotes"-part, which I admit is rubbish :-| I have removed this part from my original answer (and pinged the appropriate people in order to fix the root cause) Mar 4, 2022 at 16:32
  • Oh no worries, certainly not on you @lukaslunow and thanks for sharing. I am more furious on the issue happening at all lol. Mar 4, 2022 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.