Hi all!
I am hoping someone can help me figure out this issue. I want to be able to extract (split) text (event subject) that could look like any of the below:
EXMAPLE 1: BLOGGS, Joe (Meeting - Office)
EXMAPLE 2: BLOGGS, Joe, DOE, Jane (Meeting - Offsite)
EXMAPLE 3: SMITH, Timothy John, PHILLIP, Fairmont, GRACE Sally-Louise (Monthly Update - Richmond Office)
The results I ultimately want are:
function1:
EXMAPLE 1: BLOGGS
EXMAPLE 2: BLOGGS, DOE
EXMAPLE 3: SMITH, PHILLIP, GRACE
function 2:
EXMAPLE 1: Joe
EXMAPLE 2: Joe, Jane
EXMAPLE 3: Timothy, Fairmont, Sally-Louise
I need the last name and first name in separate functions because they are used separately later on in the flow.
Currently, I have a function that works for EXAMPLE 1 -
perfect! Thank you!
Hi @StillLearning_ ,
Okay, we have to clean input string of any comment in parentheses before because, as far as I know, we cannot do that using an expression, we need to use an Apply to each:
This needs some explanations:
Results:
If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.
it works! the only issue is that in EXAMPLE 3 ("SMITH, Timothy John, PHILLIP, Fairmont, GRACE Sally-Louise (Monthly Update - Richmond Office)") I end up with the words in-between the parentheses (Update & Richmond), as below.
Nonetheless, you have been a huge help!! thank you so much !
Hi @StillLearning_,
My bad, so sorry, just figured out I made a bad copy/paste of the expression, corrected it in my initial answer, was missing 2 right parenthesis at the end.
it is: @and(and(not(equals(item(), toUpper(item()))), greater(length(item()), 1)), and(not(contains(item(), '(')),not(contains(item(), ')'))))
If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.
okay I have no idea what I am doing wrong now. I have added the 2 parentheses in the locations noted above and now I am getting a different error -
Lacks also one ")" at the end, I think
Don't worry, I'm glad to help 😉
in your sceenshot, I highlighted where it lacks a "(":
If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.
Sorry please forgive my ignorance (you have been so helpful!) - what is it I am missing ?
This is what i am trying, but it is giving me the above 'invalid' result..
From: split(replace(outputs('Compose'), ',',''), ' ')
Expression: @And(and(not(equals(item(), toUpper(item()))), greater(length(item()), 1)), and(not(contains(item(), '(')),not(contains(item(), ')'))
That's the filter expression which is failing not the from one, it lacks a parenthesis between the 2 first and 😉
If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.
I have tried this expression - with the same "from" formula:
split(replace(outputs('Compose'), ',',''), ' ') - but it is telling me it is invalid ..