Drafts Newbie Modifying text before sending to Airtable

Context:
I’ve had Drafts for a long time, and am only now digging into using actions to trigger automations through Airtable into Make.

Action:
I have a quote that I add to Drafts each morning. The last line (which contains the citation) also has some additional information that I’d like to remove. Namely a ‘-’ and ‘@via Software’. I’m pretty confident that I can do this with Regex, but I have no clue on how to set up the action in the first place within Drafts, and then have that action run prior to my running the “Send to Airtable” action.

What I’ve done so far:
Searched the community and found several things that get me all excited to divert myself from solving this particular problem! I’ve found lots of things that will be useful elsewhere and now I’m totally overwhelmed! I’ve found syntax for setting up the kind of action I want, but I’m somehow missing the whole picture.

Ask:
Pointers to similar actions, comments or links to get me started and any other generous contributions are greatly appreciated while I save my sanity!

Cheers and thanks

Without an actual example, I can’t be 100% sure, but it sounds like your draft consists only of a quote and a citation, the citation is always the last line of the draft, and you effectively just want to remove the citation (last line), before sending the content of the draft off to Airtable.

If that is the case, while regular expressions could absolutely strip that last line, Drafts,’ template tags can do that too…

This template tag should export the first line to the penultimate line inclusive.

[[line|1..-2]]

So, if you are using the Airtable step in an action to send your content to Airtable, and with the assumptions above, then you are probably already using the [[draft]] template tag, and so you can just substitute that tag for the other.

So, there are a number of assumptions and guesses there. Take a look through, and if it doesn’t help, try providing an example draft (place the content between a pair of triple backticks “```”) and links to the Airtable action you are using.

Hope that helps.

@sylumer, Thank you for your reply and the template link.
I was about to reply to explain why I wanted to do things with Regex, then I found [[selection-only]] in the Templates User Guide which was a great help!
All I have to do now is send the info to Drafts and highlight the Author’s name before sending it on to Airtable!
Much faster! Thank you so much for saving me from a glorious - if frustrating - day following a rabbit hole!
Cheers

…using actions to trigger automations through Airtable into Make.

Just to flag that it’s also possible to go direct to Make via a Web hook from Drafts. You’d just need to adapt one of the Zapier actions to pop a Make web hook URL in. I use this to send a draft direct to a Google Sheets log. Apologies if I added to the overwhelm.:blush:

1 Like

Thank you for pointing me towards this. I will definitely check it out as I use Make every day and am happy to know that I can incorporate it with Drafts. :partying_face: