Fetch details from subjectline

Hi Everyone,

how to remove FW: and only get “WV” from email

image

the above code giving me the FW as result but i want to ignore that always if it is there.

Hi @Rakesh_Tiwari,

Try using str_array(1) instead of str_array(0). The array will look like the following, as you are splitting by space:

0: “FW:”
1: “WV”
2: “Rest of subject”

1 Like

if we do like this, then when email doesn’t have FW before it will fail and i tested it, we have to consider both case

1 Like

Hi @Rakesh_Tiwari,

Try this instead:

StateCode = item.Subject.Split("FW:").Last.Trim.Split(" "c).First.Trim

This will return “WV” regardless of “FW:” being present or not:
image

1 Like

when i writting this syntax last function is not coming and when i am pasting this syntax as it is it has srting to char conversion issue

Hi @Rakesh_Tiwari,

Can you send me a screenshot of the code you’ve pasted in, and also a screenshot of your variables pane?

Hi @william.coulson ,

did small changes.

and it worked both ways with FW or without FW

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.