Hey!
I'm connecting Slack to ClickSend (sms) and want to send and sms from a Slack message.
So the Slack message has the following structure:
"+46735112233
This is the message.
It can be on one line or multiple lines, it's all up to the person writing the message"
Now I want to split the phone number from the actual message and use them in separate parts of my zap.
The Zap
1) The zap uses string.number_extract to get the phone number. This is then used to populate the receiver field in the ClickSend action step. This step is working as intended, yihaa!
2) I then want to use the rest of the message as the body of the sms. This is where the problems begin 🙂 I have tried the following approaches:
- Split into line items using [:newline:] and then add a filter on line items NOT starting with < (since Slack formats the number as "<tel:+46735112233>"). This fails because then the whole flow stops since there is no looping through all line items in the filter step.
- Concat the line items to text. This just brings back the same problem as using the whole slack message in the first place, meaning I'm sending the number in the sms body as well....
- A Formatter Extract Pattern step which should match everything after \>.* This one actually works in the sense that it does find the ">" BUT since there is a newline after, it just returns blank. When trying to add \>/s.* or even doing a re.search(\<.*,{{message_from_slack}},re.DOTALL) in order to include the line breaks but that fails.
- Just referencing the individual line items in the sms body. But since I don't know how many items there will be, this doesn't work.
So now I'm stuck...
To summarise, what I'm trying to achieve is to get the phone number (always the first row of the slack message) as a 1 field and everything that goes after the phone number as another field.
Thanks in advance!
/Björn