Code Snippets

Ampscript, SSJS (server-side JavaScript) & SQL code for you to use


  • Better Formatting of Ampscript and SSJS Error Messages on CloudPages

    Better Formatting of Ampscript and SSJS Error Messages on CloudPages

    When building various solutions on CloudPages like consent management centers, surveys or tools used be internal teams, you might run into errors during the development phase. Here’s a code snippet for you if you don’t like feeling like trying to find a needle in the haystack of code that could land in the output of…


  • Basic Scripts to Work with HTTP Request Properties in SSJS

    Basic Scripts to Work with HTTP Request Properties in SSJS

    I developed a script to make working with HTTP requests on CloudPages and in Code Resources easier. Of course feel free to edit and remove any properties as as necessary – you might not need each of the listed properties in every script. Example Response This would be returned after hitting a code resource with…


  • HTML Table in Ampscript

    HTML Table in Ampscript

    Tabularize all the things! If you find yourself building internal tools like for non-SFMC users, you might need to display some data from SFMC in an table (either on a CloudPage or sent in an email to your team). Rather than reinvent the wheel each time the need arises, I decided to build a reusable…