ClientSecurityHash "Select(“Type=‘WI5’ AND Status=‘Open’”)"

Hello all,

I’m trying to figure out what I did wrong at Advance Training (lvl3), 1st assignment. I think I tried everything that occured to others at that step:

  • add space after “Open” in assign activity
  • dt_WIs must be System.Data.DataTable and scope of variable must be on the highest level of hierarchy
  • WIList must be DataRow and scope of variable must be on the highest level of hierarchy
  • in "WI5 is upper “i”, not lower “L”
  • I tried different upper commas sign in assign activity -"- vs -”-

Is there anything else that I missed?

My files:
Academy_ex2_ClientSecurityHash.zip (1.2 MB)

Thanks in advance
BR,
Bojan

it seems to be that dt_Wis is empty, could it be the problem ?

@Pablo_Sanchez I tried to write CSV just to be sure that scraped DataTable isn’t empty.

Could you please write that assign which is failing???

@Pablo_Sanchez see below:

To: WIList
Value: dt_WIs.Select(”Type=‘WI5‘ And Status=‘Open‘”)

Ur problem is u are assign a dt into a data row variable. Change data row variable for datatble and it will work

@Pablo_Sanchez
Can you walk me through this, please? Which variable to change to datatable?

That looks correct to me. And it should be a DataRow Array like you are doing. Although you can add .CopyToDataTable on the end to store it to a table - not recommended until you check the count of the array.

My question is, What problem or errors do you have? What you have looks correct.
You can also add brackets around the column name, but not sure it will change anything.
dt_WIs.Select("[Type]=‘WI5‘ And [Status]=‘Open‘")
You can also use .net query rather than sql, like this:
dt_WIs.Where(Function(r) r(”Type").ToString.Trim="WI5" And r("Status").ToString.Trim="Open").ToArray

To quickly check the number of rows it found, check its count:
WIList.Count.ToString

Regards.

1 Like

Hi @Bojan_Tomsic

The quotes matter.

This will not work:

dt_WIs.Select(”Type=‘WI5‘ And Status=‘Open‘”)

But this will:

dt_WIs.Select("Type='WI5' And Status='Open'")

It seems like you have the quotes from my first example in there:
image

2 Likes

You wlist variable is a datarrow, you have to change it to a datatble, as dt_Wis is.

1 Like

@loginerror That one worked :slight_smile: Don’t know how, because I tried to change those symbols before.

Thanks to all for help.

1 Like

Good catch :smiley:

1 Like

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