How to add prefix to data table

Hi,

I’m using data scraping to get title and URL from a website. But the URL which is stored in excel is missing “https://www.sgs.com”, rather than storing full URL it stores “/en/news/2021/01/safeguards-01021-cen-publishes-en-71-4-2020-experimental-sets-for-chemistry-and-related-activities”

I have used for each row
Assign:-
row.Item(“URL”)=fixVar+row.Item(“URL”).ToString()

fixVar=“https://www.sgs.com
URL is column name

Is there any other way to add specified prefix into each row of a column

@tanv.Uipat …use .insert function which will insert your url to already existing cell

Hi @tanv.Uipat

Welcome to forum

In addition to what @prasath17 said.

There is another way to do this without looping.

like after extracting the datatable containing url and text and store in dt1 variable.

Use this code in invoke code activity by passing the dt1 variable as In/Out type argument.

dt1.AsEnumerable().ToList.ForEach(Sub(row) row(1)=“https://www.sgs.com”+row(1).ToString)

then write the dt1 in a excel file.

The end result got is as

Try this workflow

process1.zip (601.5 KB)

Hope it helps you

Mark it as solution if it resolves ur query

Regards

Nived N

Happy Automation

2 Likes

Yes I’ve tried using that also
row.Item(“URL”)=row.Item(“URL”).ToString().Insert(0,fixUrl)
But it gives same result as above.

Yes it works up to the mark
Thank you so much
Happy Automation

1 Like

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