I have string "“Load Disp ENS - WI - La Crosse WI” this i will get as queue item
this value i have to select from drop down list. In drop down i will not get exact value.
I will get till “Load Disp ENS - WI” how to get part of the string.
i used split method based on delimiter Like below.
“strGroup.Split({”-“},StringSplitOptions.RemoveEmptyEntries)” with this iam getting
“Load Disp ENS” string but i want like this “Load Disp ENS - WI”
how to do that. this value is dynamic.
Can some one help me
As you mentioned you need to select from a drop down list.
The optimum solution will be to just see how many max characters are present for each option in the drop down list and then take only those many characters from the queue item.
As you mentioned once list item as “Load Disp ENS - WI”, this signifies 18 characters.
So just extract first 18 characters from the queue item.
One of the many way is to use Left function.
Left(QueueItem.toString,18)
Just in case you need below is a useful post related to the string manipulation.
Its dynamic some times 2 parts some times 3 based on data we get from API that data adding to queue in drop down values and queue item value should match
You won’t be able to split the string correctly since you don’t know where to cut or if you should cut the string at all.
Could you test if you can capture the dropdown list using the Get Attribute activity with the Attribute set to “items”? If you can obtain the list, here’s an idea:
Filter out all list items that have a partial match of strGroup, e.g. strGroup.StartsWith(item)
If there’s only one match, you have found your workgroup. If not, go to 3.
Sort the matched items by string length. The item with the longest length is your workgroup.