Hello,
I'm having a little trouble with what the right expression is to grab a string from between two points in an email subject.
The Subject of the emails that i have coming in are as follows as an example
"New Email (Text Word) has come in"
What i am trying to do is grab the string between ( and )
I have this as the expression but it keeps failing stating that the length cannot be negative.
substring(triggerbody()?['Subject'],add(indexOf(triggerbody()?['Subject'],'('),1),sub(lastIndexOf(triggerbody()?['Subject'],')'),add(indexOf(triggerbody()?['Subject'],')'),1)))
I have had a look at some of the other posts that talk about parsing text from an email subject but i couldnt get those suggestions to work for me.
Can someone tell me what i am doing wrong in my expression.
Solved! Go to Solution.
I found the error in my expression i had a ) where i should have had a (
Heres the correct expression that is working
substring(triggerbody()?['Subject'],add(indexOf(triggerbody()?['Subject'],'('),1),sub(lastIndexOf(triggerbody()?['Subject'],')'),add(indexOf(triggerbody()?['Subject'],'('),1)))
You might try spliting the string on the '(' and ')' something like this
First(split(last(split(triggerbody()?['Subject'],'(')),')'))
I found the error in my expression i had a ) where i should have had a (
Heres the correct expression that is working
substring(triggerbody()?['Subject'],add(indexOf(triggerbody()?['Subject'],'('),1),sub(lastIndexOf(triggerbody()?['Subject'],')'),add(indexOf(triggerbody()?['Subject'],'('),1)))
You might try spliting the string on the '(' and ')' something like this
First(split(last(split(triggerbody()?['Subject'],'(')),')'))
Hi @Pstork1,
Sorry to come back to an old thread. I'm trying to achieve pretty much the same setup, however I am trying to use a previous 'Initialise Variable' step in the flow as the reference point in the next 'Initialise Variable', where the email subject will be broken off. I basically require the last string of an email subject broken off, starting with the 8th word in the string, ending with up to the 20th word in the string.
This is the expression I am currently having issues with:
Build out your formula using the Dynamic Content tab and the Expressions Tab. You will find that the Variables object is addressable on its own without using TriggerBody(). That's why you are getting the error. Just start your formula on the expressions tab and then click back to the Dynamic Content tab when you need to add a specific piece of content You can go back and forth several times.
Thanks for the reply.
I came up with this using the method you advised & its doing the trick:
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
12 |
User | Count |
---|---|
127 | |
54 | |
38 | |
26 | |
21 |