ServiceNow Ticket URL in email

Hello,
im trying to click on the ticket URL from outlook when it comes in. Once the browser opens i will upload an excel file with a compiled batch of emails.
I started my script with Use Desktop App Outlook followed by For Each Email and write cell. This takes a bunch of my alert emails and writes to excel (which works so far). I then need to click on the URL for a new email that comes into a separate inbox folder and this is where im stuck. Im new to this app and need some assistance

Hi @ekos2480,

Welcome to the UiPath Community :tada:

You should not be directly click on the link in the email.
First you should be extracting the link from email body. You can easily get RegEx pattern to retrieve it.

Once you have the link just use Use application/Browser activity, pass the URL retrieved from email and take further action.

Thanks,
Ashok :slight_smile:

Thanks for that. So im very new to StudioX, How do i build that? I dont see Regex in my StudioX version

@ekos2480,

You have it in StudioX as well but it’s hidden. Enable it from Activities pan by Clicking on filter icon and checking Developer option.

image

Once selected you will get Regex activities in Developer group.

You can use Find Matching Patterns activity.

image

Regarding RegEx pattern, you will have to search or create specific to your mail body.

For example this pattern will give you first link in the Body HTML

<a\s+(?:[^>]*?\s+)?href="([^"]*)"

Thanks,
Ashok :slight_smile:

Thanks for this @ashokkarale but i think im limited, no Dev option


. See screenshot

wait looks like i was able to download the right version. i will try your steps

1 Like

So @ashokkarale i created a ForEach Email task with the Regex. Im assuming im putting the following line item <a\s+(?:[^>]?\s+)?href=“([^”])" under the properties of Regex?

@ekos2480,

Yes, in pattern field within string like this “pattern”

@ashokkarale i did that but then im lost on what to do next

@ekos2480,

Create a variable for result which will contain first URL.

Thanks,
Ashok :slight_smile:

How do i set or pull that from the email?

@ekos2480,

Click on Plus symbol at the end of Result property and select Create variable. add log message below regex pattern activity to print that newly created folder.

@ashokkarale i think i butchered this thing lol.

@ekos2480,

Not yet :stuck_out_tongue:
Check the output panel in StudioX once run finish. Do you see log messages with links?

The Grey Highlighted is the URL im trying to grab

@ekos2480

Could you please share the html body in text file here.

I will try to give you Regex pattern to extract that link.

Thanks,
Ashok :slightly_smiling_face:

Here you go @ashokkarale

The very bottom us the URL from the TASK link

Short Description: MDF/IDF Checklist

Assignment group:

Assigned to:

Due date:

Location:

Click here to view Task: TASK9297688


Description: Please include the following information in your closing comments:

  1. Backup power available? (Yes, No, N/A)
  2. AC working as expected? (Yes, No)
  3. Any warning or error lights detected? (Yes, No)
  4. UPS working and batteries showing healthy? (Yes, No)
  5. Trash removed from MDF/IDF? (Yes, No)

Additional Information:

Ref:MSG99053718

https://urldefense.proofpoint.com/v2/url?u=https-3A__thermofisherit.service-2Dnow.com_nav-5Fto.do-3Furi-3Dsc-5Ftask.do-253Fsys-5Fid-3Dd3f80a581be91118715b42addc4bcbd3-2526sysparm-5Fstack-3Dsc-5Ftask-5Flist.do-253Fsysparm-5Fquery-3Dactive-3Dtrue&d=DwMCaQ&c=q6k2DsTcEGCcCb_WtVSz6hhIl8hvYssy7sH8ZwfbbKU&r=ecVF1x1ndla9nZHDfFSkLS3oKN1cxJJNCYNr_eg6AKk&m=3DsIWERpQCVDQyTUxn9ciLutqvJsH1K0vaqHTtIRu9J_xyaLkd2ARK-DpO8Q6n7m&s=AqsewUmRCfapHXc73EEzmGoy90AqfF_jRKPUAjHDeck&e=