Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Spriggs wvpv

View GitHub Profile
View sfmc-ampscript-baby-shark-multiple-concat-loop.amp
%%[
set @s = buildrowsetfromstring("Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end","|")
set @d=", doo doo doo doo doo doo"
set @n=char(10)
for @v=1 to 9 do
set @r = row(@s,@v)
set @f = field(@r,1)
outputline(concat(@f,@d,@n,@f,@d,@n,@f,@d,@n,@f,"!"))
View sfmc-ampscript-baby-shark-string-concat-loop.amp
%%[
set @s=buildrowsetfromstring("Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end","|")
for @v=1 to 9 do
for @l=1 to 4 do
set @r = row(@s,@v)
set @f = field(@r,1)
View sfmc-ampscript-baby-shark-string-char-loop.amp
%[
set @s = "Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end|"
for @i=1 to 112 do
set @c = substring(@s,@i,1)
if @c == "|" then
View sfmc-ampscript-baby-shark-double-loop-string-parse.amp
%%[
set @s = "Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end|"
for @v=1 to 9 do
set @f = substring(@s,1,add(indexOf(@s,"|"),-1))
set @s = replace(@s,concat(@f,"|"))
for @l=1 to 4 do
View sfmc-ampscript-baby-shark-single-loop-mod-math.amp
%%[
set @s = buildrowsetfromstring("Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end","|")
for @v=1 to 36 do
set @l=substring(add(divide(add(@v,-1),4),1),1,1)
set @r = row(@s,@l)
set @f = field(@r,1)
View sfmc-ampscript-baby-shark-single-loop-mod.amp.amp
%%[
set @l = 0
set @s = buildrowsetfromstring("Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end","|")
for @v=1 to 36 do
set @m=mod(@v,4)
set @l=add(@l,iif(@m==1,1,0))
View sfmc-ampscript-baby-shark-260-uncompressed.amp
%%[
set @s = buildrowsetfromstring("Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end","|")
for @v=1 to 9 do
for @l=1 to 4 do
set @r = row(@s,@v)
set @f = field(@r,1)
View sfmc-ampscript-baby-shark-260.amp
%%[for @v=1 to 9 do for @l=1 to 4 do outputline(field(row(buildrowsetfromstring("Baby shark|Mommy shark|Daddy shark|Grandma shark|Grandpa shark|Let's go hunt|Run away|Safe at last|It's the end","|"),@v),1),iif(@l<4,", doo doo doo doo doo doo","!"))next next]%%
@wvpv
wvpv / sfmc-ssjs-triggeredSendSummary.js
Created Oct 19, 2020
TriggeredSendSummary to Data Extension Row
View sfmc-ssjs-triggeredSendSummary.js
<script runat="server">
Platform.Load("core","1");
var debug = true;
try {
var prox = new Script.Util.WSProxy();
// https://salesforce.stackexchange.com/questions/178299/setup-an-email-notification-to-admin-when-triggered-sends-exceed-a-level-of-500/230406#230406
@wvpv
wvpv / sfmc-ssjs-retrieve-automation-with-wsproxy-results.json
Created Sep 4, 2020
SFMC SSJS Retrieve Automation with WSProxy - Results
View sfmc-ssjs-retrieve-automation-with-wsproxy-results.json
{
"Status": "OK",
"RequestID": "40ff6f0d-5f64-4201-b441-671d70a49279",
"Results": [
{
"Schedule": null,
"AutomationTasks": [
null,
null,
null,
You can’t perform that action at this time.