Conditional Region using API with dynamic values

Hi, working using expressions in conditional region with dynamic values just not working.

Table dbdays:

id | userid | day1 | day2 | day3 | day4
 1     20       1      1      1     1

API (show_days):
(Output) Database Query: Select * FROM dbdays WHERE userid = identity

UI:

App
>Serverconnect1 (API/show_days)
->Container
-->Row
--->Repeat (4)
---->Form
----->Conditional Region: serverconnect1.data.show.days[].day1 ==NULL)
------->More form objects.

Problem is when conditional region calls a different column from query in the same API, for example,
This works, doing this I always get the same column from table, because repeater of course take same expression from conditional region, and the four instances of the form call “day1”.

Conditional Region: serverconnect1.data.show.days[].day1 ==NULL

So I was suppusing that doing this could works, using the index from repeater, but not, the idea is that repeater (4) dynamically assign to each instance the propper number (1, 2, 3, 4 next to .day).

Conditional Region: serverconnect1.data.show.days[].day{{$index+1}} ==NULL

What I want to do is to hide each form using serverconnect and not a simple “display none” that make each form available if someone else with developers tools just untick the “display none” css.

Instead of using a repeat, try using the where formatter so you can pass it the full data set and filter through it.
Something like serverconnect1.data.multiquery.where('days', NULL, '==') but use the built in dynamic formatters in Wappler rather as my little code sample is literally out of my head, and more than likely slightly incorrect, but it gives you a rough idea on how you can pass the entire array to the where formatter and filter out the result you want client side.

To be very honest I am not sure if the concept on how you are trying to do this is the best way, but that depends entirely on your particular needs, so only you will know why you are doing it this particular way.

Sounds to me that you have 4 forms
userid 20 could have access to only one of those forms
userid 21 could have access to 3 of those forms
userid 22 could have access to all 4 of the forms

You do not want userid 20 accessing the forms they should not be seeing, therefore you should user user permissions rather, and your conditional region should be rather saying all users with full access can see 4 forms, all users with standard permissions should see 1 form etc.
Much easier to setup in that way.

Thanks for reply,
This is the idea:
The table dbdays is for a simple assistense system,

The forms of each day shown for first time to user, the page will show only the day of these assistence day with the help of another condition using dates, so the first assistence day insert a new row in table “dbdays”, in this way.

The API “show_days” its actually “show_day1”, has a database insert that create a row for that user with propper userid (identity) and in the column “day1” a binary value (1), others columns will be NULL.
Now for the second form I call a second API call “show_day2” this update only the column “day2” from same table, working like this, one database query that search the userid in same table “dbdays”, then a condition if user exist updates that row and only the column “day2” with a value 1.
The other forms for day3 and day4 will be the same.

So part of the idea is to hide the form if column “day1” is equal to “1” (Marked Assistence), that’s why my conditional region pretend to do, if NULL the form is shown.
And too if form is not in date the form will keep hide it. (But this part I have solved).

For this reason is that I want to use Conditional Region in this way:
serverconnect1.data.show_days[].day{{$index+1}} ==NULL
Because each form call a different column in the same table of the same user.

But right now I think that I’m going to change the model of this table from horizontal to vertical, I mean, one row for each assistence day, then if I’m correct I can call each row of the same user only with the array probably like this:
serverconnect1.data.show_days[$index].day == NULL

But before that, maybe is possible to do what I want to do in first instance.
Thanks in advance.