Sine
(Klingsholm)
December 20, 2018, 8:50am
1
Hi! @nadim.warsi
I am on assignment 2 in level 3.
I am able to upload all WIID to the queue in orchestrator but when I am getting to the Get transaction data workflow I get this error: If more items: Value cannot be null. Parameter name: Source.
I hope that someone can help me with this as I dont understand what the error means at all…
Your WIList is empty so its giving that error. You can check that by using a WriteLine just before this if.
The issue may be that in the invoke of GetTransactionData you have not assignment the value of the in argument
Sine
(Klingsholm)
December 20, 2018, 12:27pm
3
Great thanks!
How can I trim this value so I only get first name and last name?
Firstname Lastname
Client Country: Country
1 Like
Sine
(Klingsholm)
December 20, 2018, 12:50pm
4
I tried this
Left(InStr(newLine),(InStr(newLine)-1).ToString
Sine
(Klingsholm)
December 20, 2018, 12:56pm
5
@nadim.warsi hope so much you can help me
1 Like
just split on basis of new line and hen for 0 split basis of space and result will be
FN = text.Split((Environment.NewLine).ToCharArray)(0).Split(" “c)(0).ToString
and
LN = text.Split((Environment.NewLine).ToCharArray)(0).Split(” "c)(1).ToString
Sine
(Klingsholm)
December 20, 2018, 1:40pm
7
Hi @nadim.warsi
I am not sure how I should assign these?
just retype the " " quotes
as in copy it takes as a special char
Sine
(Klingsholm)
December 20, 2018, 1:42pm
9
Hi again,
I have been able to extract Client ID and Client Country but I am missing Client Name.
So that is why I want to keep the first line and then delete the next line which always will be “Client Country: XXX”
ok, simply use the below in your code after you are doing the getText. This will get you all 3 values
What you can do then is:
After you GetText
Use yourvar.Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries) - result is array of strings with index values of each line (which is =3)
First line: yourarray(0).Split(":"c)(1).Substring(1) = ClientID
Repeat for array index 1 and 2 for ClientName and Country.
Let me explain it
You have this
[image]
Your variable is a string with new lines and empty spaces.
Hence:
Use yourvar.Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries) - to remove the new lines characters and empty spaces.
Output of this will be “ClientID: LUJ23971,Client Name: Chance Strittmatter,Client ID: PU23971” which is an array of strings say “yourarray”
To get values from array using index you do this and then take the value after “:” split again and the u…
Sine
(Klingsholm)
December 20, 2018, 1:48pm
11
Hi again,
I am just afraid to change the code as everything else works. I only need first and last name…no way to do that in another way?
1 Like
what is the name of your variable which holds the text?
Means what you are setting in the messagebox?
Ill give you the expression
Sine
(Klingsholm)
December 20, 2018, 1:54pm
13
out_ClientCountry (So the our argument Out_ClientCountry contains the message I pasted above “Veda Blaylock etc…”
1 Like
ok, but should that not be the second part ? but you want the name?
For the Name you can use this expression:
out_ClientCountry.Split(Environment.NewLine.ToArray)(0).Trim
Sine
(Klingsholm)
December 20, 2018, 1:58pm
15
I basically only need the client name, and in this case it is Veda Blaylock
What kind of arguments/variables should I have?
than you so,sooo much for helping me a lot!!
actually to make it simple you just split and take the vales from the GetText variable and then assign each value to the out variables ID, Name and Country.
Not sure why you are getting the Name from the out_ClientCountry argument
Let me know if it works
Sine
(Klingsholm)
December 20, 2018, 2:08pm
17
Hi
Unfortunately I end up with an empty message box…
I think you have empty entries Try this:
out_ClientCountry.Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries)(0).Trim
or switch to second element after split
out_ClientCountry.Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries)(1).Trim
Sine
(Klingsholm)
December 20, 2018, 2:14pm
19
I will try both codes, and what I do is that I have an assign activity where I put one of the codes in the Value and then I assign it to out_ClientNameTrue. After that I have a write line and message box to keep track
Sine
(Klingsholm)
December 20, 2018, 2:15pm
20
The first code worked. AMAZING!
Thank you so much
2 Likes