0

I am using the variable path below to upsert a data to Coda.

{{steps.trigger.event.body.actions[0].name}}

The code above returns an example output below:

CO-DEN - IBC 2021

What I really want to insert is only ‘CO-DEN’, the first word from the output. Is there anyway to tokenize the data to be upserted? Thanks.

enter image description here

alyssaeliyah
  • 2,214
  • 6
  • 33
  • 80

1 Answers1

1

Yes. I can help with the easy & ugly solution. Simply use the split function to achieve what you want.

In example:

var sentence = '{{steps.trigger.event.body.actions[0].name}}';
var firstWord = sentence.split(' ')[0];
Ali Reza Dehdar
  • 1,991
  • 1
  • 15
  • 17