<aside> ⚠️ The formula for Current mood(s) for rollup has changed but I haven’t yet updated these instructions. Basically, it’s intended to make it look nicer if there are two many moods.

</aside>

<aside> 1️⃣ Make the rollup nicer to work with

prop("Current mood(s)")

</aside>

<aside> 2️⃣ Extract the commas

replaceAll(prop("Step 1️⃣"), "[^,]", "")

</aside>

<aside> 3️⃣ Count the commas

length(prop("Step 2️⃣"))

</aside>

<aside> 4️⃣ Extract the last word of the string created in step 1

replaceAll(prop("Step 1️⃣"), ".*[^A-z]", "")

</aside>

<aside> 5️⃣ Chop the last word of the string created in step 1

slice(replaceAll(prop("Step 1️⃣"), ",", ", "), 0, length(replaceAll(prop("Step 1️⃣"), ",", ", ")) - (length(replaceAll(prop("Step 1️⃣"), ".*[^A-z]", "")) + 2))

</aside>

<aside> 6️⃣ If the count of commas in step 3 is greater than 0, make a new friendly string. If not, do nothing.

if(length(replaceAll(prop("Current mood(s)"), "[^,]", "")) > 0, concat(replaceAll(slice(prop("Current mood(s)"), 0, length(prop("Current mood(s)")) - length(prop("Current mood(s)")) - add(length(replaceAll(prop("Current mood(s)"), ".*[,]", "")), 1)), ",", ", "), " and ", if(length(replaceAll(prop("Current mood(s)"), "[^,]", "")) > 0, replaceAll(prop("Current mood(s)"), ".*[,]", ""), "")), prop("Current mood(s)"))

</aside>

Powered by Fruition