mchlebik
(Martin Chlebik)
February 27, 2018, 3:26pm
1
Hi there,
i’m reading a info from cell in Excel - which gives me output genericValue. I need to use this value for Excel -Filter table → FilterOption where String is the only supported variable type.
UiPath is obviously saying that it cannot convert it to 1-dimensional array.
Any suggestion please?
arivu96
(Arivazhagan A)
February 27, 2018, 3:41pm
2
Hi @mchlebik ,
create one String[] variable → arrstring
your string/genericvalue → strvalue
use assign activity
arrstring={strvalue.ToString()}
Regards,
Arivu
Mr_JDavey
(Joshua Davey)
February 27, 2018, 5:27pm
3
Hi there @mchlebik ,
As noted by @arivu96 , you can create an Array(Of String) and add your value there.
Alternatively, you can achieve this by adding the below directly into your ‘FilterOptions’ property:
{genericValue.ToString()}
Thanks in advance,
Josh
mchlebik
(Martin Chlebik)
February 28, 2018, 3:03pm
4
Thanks @Mr_JDavey and @arivu96 . This partially solved my issue.
Even though i dont have any validation errors, the FilterOption is not working (with the dynamic configuration)
If I use an Array(of String) manually / hardcoded - {“FREIGHTSOFT”, “GRP”} - the Excel is filtered as it should.
But if I’m using the array, which I gather from the cell (read cell) - the Excel is filtered by some thing which is not in the Column.
I have no idea where is the issue - any ideas?
Mr_JDavey
(Joshua Davey)
February 28, 2018, 3:43pm
5
Hi there @mchlebik ,
Do you mean you are extracting the information:
{“FREIGHTSOFT”, “GRP”}
From a workbook, then attempting to use that for filtering?
If so, you will end up with an Array(Of String) similar to the below:
{“{FREIGHTSOFT, GRP}”}
As such, there is no field that matches:
{FREIGHTSOFT, GRP}
Thanks,
Josh
mchlebik
(Martin Chlebik)
March 1, 2018, 8:32am
6
Thanks Josh → you rock - this was the issue, that I had additional characters there.
PS:Since I dont know any better.
From the excel cell 1 - im taking first filter and from cell 2 im taking second filter.
With this I have the dynamic filter.
Thanks a lot once again.
1 Like