How to remove unwanted string in the Excel row using a wildcard

Hi there!

I am working on a simple automation wherein I am extracting data from web and writing it to an excel sheet. There are two columns, one is NAME and the other is URL.

In the URL column, the data contains something like this:

I want to remove any string starting from the question mark so I’d be left with

The sequence looks like below.
Open Browser > Data Scraping > Excel Application Scope > ??? Cleanup data table (remove unwanted string)

How do I proceed to do that?

Thanks in advance.

save URL into a variable(say Url) and use the command “Url.substring(0,Url.indexof(”?“))” to remove any string starting from ?

1 Like

we can do it defensive with methods from the URI Class

And can also handle if the query part is missing

Substring failed in that case

Hi @kimuhm
You can try this way as specified in sample workflow
it will remove the required part using invoke code (3.4 MB)

Mark it as solution if it helps you
Nived N
Happy Automation