Hi guys!
I´m trying that a compose action returns the subject email, but not completed, and example could be like this:
If and email arrives with this subject - Test 13 PM Stage3, then i want that the compose returns Test 13.
but if the subject email is Test PM Stage3, then the compose return Test.
I have a function in the compose:
if(
or(
equals(length(split(toLower(triggerOutputs()?['body/subject']), '[_/\\s-]')), 4),
equals(length(split(toLower(triggerOutputs()?['body/subject']), '[_/\\s-]')), 5)
),
concat(
split(toLower(triggerOutputs()?['body/subject']), '[_/\\s-]')[0],
' ',
coalesce(split(toLower(triggerOutputs()?['body/subject']), '[_/\\s-]')[1], '')
),
first(split(toLower(triggerOutputs()?['body/subject']), ' '))
)
But when i receive and email with the first example i give you (Test 13 PM Stage13), it returns to me only "Test".

I´ll give a little bit more of context, I want that if the first word of the email subject is text and the second one is a number, then the compose returns to me this two values.
Example Email Subject - Test 1313 PM Stage 15
Returns - Test 1313
But if the first condition is not correct, then returns only the first word of the subject.
Example Email Subject - Test PM Stage 15
Returns - Test