I am experiencing problems trying to eliminate some text of a string. The use case comes when I make a draft note for every calendar event
When I Import the Notes field, some times there is garbage in this field, coming from the Teams links, instructions and so forth
What I am trying to do is splitting by lines and trying to eliminate lines containing those words
Using a List first and then am If sentence for every splitted line
Question: how can I define an “if” statement to compare every item with a “list” of strings?
Attaching the screen shots
Thanks in advance, always appreciative of the support you give to the community guys
Let’s step back a bit, because I suspect we have a case of the XY Problem.
From the gist of it I feel like going through a list is more work than it’s worth while Regular Expressions may be more adequate.
Are you trying to keep parts of that whole Teams text?
What is your whole process and what are you trying to automate exactly? I’m not familiar with draft notes for calendar events. I know events have notes but not what a draft is in this context. EDIT: got it, you’re talking about the Drafts app (I just saw the tag)
I reread your message and I understood better the issue. I gave it a try with a shortcut that uses a Replace Text action with Regular Expression option enabled. So in one action, all the Teams-specific text is removed (even though the URLs vary on each event)
Thanks!! While not being able to use regex myself, I do believe this should be the roght method However once I wrap the action in real use case (see shortcut) the Replace Text action is not working and is not able to trim any of the lines (Microsoft Teams text block still appers)
What I did was copy the text from your initial post and based my Shortcut on that, but maybe is Microsoft Teams generating notes in ever slightly different ways so that the regular expression doesn’t catch it every time.
I did a new version, this time a bit more flexible, i.e. this shortcut detects then deletes any of the following lines in any order:
Microsoft Teams meeting followed by Enter
Join on your computer or mobile app followed by Enter
Click here to join the meeting followed by any amount of characters, followed by Enter
Meeting ID: followed by any amount of characters, followed by Enter
Passcode: followed by any amount of characters, followed by Enter
Download Teams followed by any amount of characters, followed by Enter
Learn more followed by any amount of characters (no Enter here, because it’s the last line)
About regular expressions used: ^ means the line I want to capture starts there . means any character * means any amount of times (so .* means any amount of any characters) \n means Enter