I am trying to get some data parsed out of a subject line in Office 365 Flows. I have an email that has a consistent format:

Help Desk [Ticket #12345] 

I want to get the number '12345' for use in later steps in the flow. So far, I've attempted to use the substring expression in a compose connector:

substring(triggerBody()?['Subject'], 20, 5) 

But I get an error about the string being null.

1 Answer

Besides the index being incorrect (to retrieve '12345' from Help Desk [Ticket #12345] you need to use substring(value, 0, 5) as the index is 0-based), the expression looks correct. But you can take a step-by-step approach to see what is wrong.

To start, take a look at the flow run to see exactly what the trigger outputs are: E-mail trigger

If you see the Subject field (as I do in my case), create a variable containing that value only to make sure that you don't have any typo: enter image description here

If it works correctly, then you should see in the flow run the subject: Subject

If everything is still good at that point, create a new variable with the substring that you want: enter image description here

And again, check the value. enter image description here

If you got to this point, then you should be able to retrieve the ticket id.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.