Skip to main content

Rafal Wolsztyniak

Tips

SSJS Library for data visualization in Salesforce Marketing Cloud

I'm designing and developing a new SSJS script library with the intention to make visualization of data stored in Marketing Cloud easier.

The library is available in the ChartFormer Library repository on GitHub, but please consider this an early alpha.

For now the focus is to provide a set of functions that output data in a form that can be used by various types of Google charts:

The ChartFormer repo contains examples on how the library can be used. Better documentation will come in September.

Follow me on Twitter or LinkedIn to get update on the progress of this development.

Rafal Wolsztyniak

Tips

Sharing the wisdom

Michał Rzepka started something amazing with his #SFMCTipsAndTricksChallenge on LinkedIn in which the members of the SFMC community were asked to share 3 tips about the system. Lots of people responded already sharing great tips for beginner and advanced developers alike.

So, it's my turn to share:

  • How I'm a big fan of the console.table() function in client-side JavaScript for debugging
  • What the dreaded Error 500 message on a page without SSJS or Ampscript teaches us about proper testing and the CloudPagesURL() function
  • How data binding can be used to create a basic logging mechanism writing personalized values with the Update Contact Block in Journey Builder

Rafal Wolsztyniak

Wordle

Recreating the instant classic

You might already be one of those people whose daily ritual includes solving the daily Wordle puzzle.

Developed by Josh Wardle, this game has become a viral sensation and has probably made millions of people scratch their heads while searching for the right 5-letter word and testing their knowledge of their English vocabulary.

The game is simple and I couldn't help but wonder what it would take to recreate it Marketing Cloud. The game itself uses JavaScript, so doing it in SSJS would be pretty much redundant, so I decided to recreate it in Ampscript.

Needless to say:

Rafal Wolsztyniak

Pivot! Pivot! Pivot!

If you have ever wanted to analyze some data exported from Marketing Cloud in Microsoft Excel, you might have noticed most dates are displayed incorrectly: some behave like strings and some are dates that appear to be different than you had in your data extension.

Rafal Wolsztyniak

Have you ever wondered what fun things could be built with pure Ampscript?

Yeah, Neither have I.

Yet here we are and you can read about the inspiration for this self-assigned exercise and the process here: Ampscript Tic-Tac-Toe

For a limited time, you can also just go straight to the game and play it in two modes:

  • Single Player against the super clever yourself "AI" I stitched together with a bunch of conditional statements
  • Local Multiplayer against another player at your device or yourself.

Rafal Wolsztyniak

Windmill

%%[ 
set @greetings = "SFMC Developers"
OutputLine(Concat("❤️ Welcome, ", @greetings, "!"))
]%%

Welcome to yet another technical blog about Salesforce Marketing Cloud from a certified Marketing Cloud Developer with almost 5 years experience and a history of short affairs with various programming languages and frameworks.

There's not much here at the moment, but rest assured that I will do my best to deliver future content the use of AMPscript and SSJS (and perhaps some SQL).

PS. I'm also retroactively added two articles below to showcase two coding challenges I took part in.

Rafal Wolsztyniak

OneMoreTime

I Won Something!

I was surprised to learn my code won in the "Efficiency" category of the "One More Time" coding Challenge hosted by the amazing people of HowToSFMC.

The goal was simple: recreate the lyrics of the classic Daft Punk song using only Server-Side JavaScript in Salesforce Marketing Cloud which turned out to be a really interesting task (and had me obsessing about such things like the count of commas in the lyrics). Some blunders were made, but the code I submitted turned out to have the shortest length which allowed me to win in my category.

The winning solution

<script runat="server">w="Celebration Celebrate celebrate Music's dancing feeling tonight right, Don't Need, We're can't dance don't gonna right we're yeah, Come Hey! Just Mmm, free just know late more need stop time wait yeah I'm One You all and got on, the too you Oh We do it me no so".split(' ');s="⣰⣰♫⣰⢚⢞⢒♫⢺⢡⢳⢟♫⢘⢬⢷⢔♫⣰⢚⢞⢒♫⢺⢡⢳⢟♫⢘⢬⢷⢔♫⣰⢚⢞⢒♫⢺⢡⢳⢟♫⢘⢬⢷⢔♫⣰⢚⢞⢒♫⢺⢯♫⣰♫⣰⢚⢞⢒♫⢺⢡⢳⢟♫⢘⢬⢷⢔♫⣰⢚⢞⢒♫⢺⢯♫⢘⢬⢷⢔♫⣰♫⢥⢹⢨⢰⢧⢕♫⢐⢖♫⢑♫⢘⢮⢸⢩♫⢥⢿♫⢻⢝⢬♫⢲⢛⢬♫⢚⢞⢒♫⣰⣰⣰⢐♫⢲⢨⢠⢞⢼⢽⢗⢖♫⢣⢤⢕♫⢓⢵⢾⢕⢷⢫♫⢙⢯♫⢢⢶⢳⢟♫⢚⢞⢒♫⣰⢑⢴⢜⣀⢦♫⢓⢵⢾⢕⣀⢦♫⢑⢴⢜⣀⢦⣷⣷⣷⣷⣷♫⣷⣷⣷⣷♫⣰⢓⢵⢾⢕⣀⢦♫⢚⢞⢒⣷⣷♫⣷⣷⣷⣷".replace(//g,'♫⣰⢓⢵⢾⢕⣀⢦♫⢚⢞⢒♫⢑⢴⢜⣀⢦').replace(//g,'⢱⢪⢭♫');for(c=0;c<s.length;c++){i=s.charCodeAt(c)-10384;if(i>=0){t=w[i]+' '}if(s[c]=='♫'){t='<br>'}Platform.Response.Write(t)}</script>