Filter using a controler


I would like to create a small tool calculating the chance of winning between to opponents selected via 2 controlers.

I’m stuck at one of the first step.

I have a table with the different weapons and winning chance associated

I created the controlers.
Example for the first one:

I then wanted to compare the winning chances of both weapons.
To do that, I tried to get one winning chance of one weapon, depending on the controler.
I did that code, which did not work

But when I did the same code except I dont use the controler but text entry, it does work

What am I doing wrong?
Thx for the help :slight_smile:

Your Controllers’ Selectable Options is a table, so each option is a row. I.e. Weapon1 returns not the
name of the weapon but the full row, and you are trying to test if a Text Column contains a Row.

To fix that you either make your Selectable Options as Weapons.Weapon or change the filter to Weapons.Filter(currentValue=Weapon1).wins (I prefer the latter).


Thx a lot!

Your second option works fine.
What does the “curentValue” does exactly? It checks all the cells ? Only the firts column cells?

I tried the first one (Weapons.Weapon), which is more intuitive to me, but it doesn’t work.
Actually, I think I already tried it before, reading answers on this forum about that problem, but it already did not work for me. (Battles section)