Unable to capture the client ID, Client Name, Client country

image

Once I captured this what should I do next?

Can you tell me how to use string manipulation in this

Use Split String. GIive Input as Get Text Output
Use “:” as the Separator.
Output would be array of string.

Hi @balkishan

Checkout the attached workflow… This might help you to get it sorted…

System1_ExtractClientInformation.xaml (16.0 KB)

1 Like

@balkishan,
Use below one:

Client ID: Client.Substring(Client.IndexOf("Client ID: ")+"Client
ID: ".Length).Split(Environment.NewLine.ToCharArray)(0)

And same way try for other Two also.

2 Likes

@balkishan I have attached a work flow please go through it and let me know Main.xaml (8.1 KB)

Regards,
Mahaling Patil

@MahalingPatil : As I went through your workflow here you didn’t declare any out parameter bro

I have created variables,you could have create arguments and assign values to arguments.

Regards,
Mahaling Patil

You must have variables, Clientinfo which type is a GenericValue and idtoremainstr which type is a string array, three arguments out_ClientID, out_ClientName and out_ClientCountry then Use an Assign Activity

assign idtoremainstr = clientinfo.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)

Assign
out_ClientID = idtoremainingstr(0).Split(":“c)(1).Substring(1)
out_ClientName = idtoremainingstr(1).Split(”:“c)(1).Substring(1)
out_ClientCourtry = idtoremainingstr(2).Split(”:"c)(1).Substring(1)
To see if it’s doing what you expect it to do you can print it using Write Line activity and put the below on Text

out_ClientID+"-"+out_ClientName+"-"+out_ClientCountry

1 Like

Thanks for your efforts bro.
BTW you already declared a clientdetails var type generic in the workflow. Can you tell me why do we need to declare idtoremainstr ?

If you look we are using idtoremainstr variable which is an array to split the values in the Get text.

Clientinfo is the Value in the Get Text property
image

2 Likes

Simple words the idtoremainstr stores the value from our Get Text activity them split them using the New Line

Hope this will be helpful

1 Like

Yes, It helps a lot bro :slight_smile:

1 Like

You are welcome

1 Like

Hey thanks for this @lakshman . It was very useful. Do you think you could take me through the lines and explain what is going on? I get that its finding client ID and the length of the word and grabbing that. But that is all I understand. Is the client ID portion a selectors thing? Or would it work on any website with that kind of data? --> IE if it said “customer ID” would it still work?

1 Like

No.

Yes it will work. In this case, you have to replace Client ID with customer ID

Thanks for getting back to me! Can you please explain this portion of the code?

Split(Environment.NewLine.ToCharArray)(0)

I know you can change the (0) portion to 1, 2, 3, etc but I don’t fully understand it

PS

You are the man

Thanks!

out_ClientID = ClientInfoDetails.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)(0).Split(":"c)(1).Trim

out_ClientName = ClientInfoDetails.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)(1).Split(":"c)(1).Trim

out_ClientCountry = ClientInfoDetails.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)(2).Split(":"c)(1).Trim

3 Likes

ClientInfo is variable of GetValue Activity

ClientId=ClientInfo.Substring(ClientInfo.IndexOf("Client ID: ")+"Client ID: ".Length).Split(Environment.NewLine.ToCharArray)(0)

ClientName=ClientInfo.Substring(ClientInfo.IndexOf("Client Name: ")+"Client Name: ".Length).Split(Environment.NewLine.ToCharArray)(0)

ClientCountry=ClientInfo.Substring(ClientInfo.IndexOf("Client Country: ")+"Client Country: ".Length).Split(Environment.NewLine.ToCharArray)(0)

use write line activity to cross check
ClientID + “-” + ClientName + “-” + ClientCountry