I have two value in a single cell of excel file and I want to write it in the URL

Hi,

I have two value in a single cell of excel file and I want to write it in the URL. Can some help me with it?
The expression used to get the value from excel is:
http://0.0.0.0:0000/v1.0/api/StickyNotes?noteTypeId=4&vNo=” +row(“NO”).ToString +“&ID=” +row(“ID”).ToString +" "

image

image

@VIDIT_ZALA

@VIDIT_ZALA What is the Problem that you are facing ? Seems like you’re using the right expression :sweat_smile:

Although if the Second Column Value in two Different lines is the issue, then can you tell what do you want to do with it?

Hi,
Please elaborate your issue.
If you want the url value like “http://0.0.0.0:0000/v1.0/api/StickyNotes?noteTypeId=4&vNo=1116887&ID=056A072A" - Solution is replace the newline (“\n”) with “” if ID value is having new line. If there is no new line or any space between 056A and 072A then your expression is right.

If you want the URL separately like “http://0.0.0.0:0000/v1.0/api/StickyNotes?noteTypeId=4&vNo=1116887&ID=056A" and “http://0.0.0.0:0000/v1.0/api/StickyNotes?noteTypeId=4&vNo=1116887&ID=072A" - Solution is split the value and create separate urls

Please provide the sample input file to work on

@supermanPunch I am able to load the first ID in the URL but I am not able to load the second ID.

@Venugopal24 Is it possible to use , as separator if we want to add 2 values together in the URL. And yes there is space in the cell. Can you please help me with it.

Yes it is possible. You can use replace function.

row.Item(“ID”).ToString.Replace(" “,”,")

It will give the value like 056A,072A (replaces the once space with ,

Please Mark as solution if it works

@Venugopal24 Thanks for the help let me check and get back to you.

@Venugopal24
Hello,

The solution worked but what if we have single value in ID column in excel file?

you can check the condition if it is having space If(stringVariable.contains(" ")) then give the logic for replace otherwise no need to give replace logic

Mark as solution if it works

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