Help with formula in table

In a table, I have a column titled ‘Session Name’. In the list, about 1/3 of the rows contain the word ‘SenseMaking’ within a longer label.
(i.e. ‘Social System Mapping SenseMaking Session | July 4th, 2022’ as opposed to 'Social System Mapping DeepDive Discussions | June 20th, 2022)

I have another column called ‘Duration’ it contains two list options: 1 hour (US Central time zone), 1.5 hrs (US Central time zone)

I want to create a formula whereby all session names containing the word ‘SenseMaking’ return “1.5 hrs (US Central time zone to the Duration column.”
And I’d like all other session names to return “1 hour (US Central time zone)” to the Duration column.

I’ve tried variations on: thisRow.[Session Name] =ContainsText(“SenseMaking”) , but can’t get it to return even a true. . .

How do I do this?

1 Like

Hi Christine

Hopefully this helps:

Rambling Pete

1 Like

hi @Piet_Strydom , thanks for showing the ContainsText()
it seems that the CFL got enriched by another new function

3 Likes

:wave: Hi @Christine_Capra !

Just wanted to add in a quick observation I had as I was readying your post. You put down that you had the formula:

thisRow.[Session Name] = ContainsText("SenseMaking)

When you are using formulas in Coda you are going to need to use a concept called Chaining

Chaining is were you chain, or attach a formula to the end of the item you are attempting to perform the operation on using a . - - - In your case you used an = which is used to compare like values

As an as example, you could have done the following:

thisRow[Session Name].ContainsText("SenseMaking)

That would have returned either true or false for you. Hopefully that helps!


For more help or tips on all things Coda im sharing all the time on:

3 Likes

HI @Christiaan_Huizer

I didn’t know it was new. But these guys develop so fast…

But it was the only one of this type of formula that seems to look “inside” a word.

P

1 Like

hi @Piet_Strydom , Coda did not yet mention it, but @Scott_Collier-Weir was so wise to share it on Twitter on May 30. We also recently had Duplicate() , again via Scott I noticed it.

I don’t understand why Coda does not take more time to introduce these improvements, maybe they are a bit shy :wink:

4 Likes

They usually announce these in their “X new recent improvements” bulks like this:

The formulas documentation is rendered automatically whenever there’s a formula added to the code and it’s not hidden. That’s why these show up in the formulas list earlier and the sharp-eyed spot them before everyone else :slight_smile:

2 Likes

Hey all @Piet_Strydom, @Christiaan_Huizer, @Scott_Collier-Weir , @Paul_Danyliuk,

Apologies for the delayed response! It took me awhile to get back to this.
In fact I was really just trying to get at the beginning of a multi-part if/then, and all of your clues were helpful.
Here’s what I ended up with, it works perfectly! :grinning:

SwitchIf(thisRow.[Session Name].Containstext("SenseMaking"),"SenseMaking", thisRow.[Session Name].Containstext("DeepDive"),"DeepDive", thisRow.[Session Name].Containstext("OnRamp"),"OnRamp", thisRow.[Session Name].Containstext("Office Hour"),"Office Hour","") 
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.