Filter a list by 3 criteria, jump from parent to grandchild table, have a continuous procedure

Hello peoples.

I am trying to develop an app to assist me in the work I am doing currently at a paint mixing and selling facility. The main purpose of the app is to help me make a whole range of colors out of a reduced catalog of colors by combining them, red and blue to make purple; yellow, red and black to make brown, et. As thaught in elemantary school.

Among others I have a able named “formulas” and three tables that are in a parent-child relation to each other: Pedidos (Spanish for Orders), Cubetas (Spanish for buckets) and Detalles (Spanish for details). In the first mentioned table “Pedidos”, a Purchase/ Work is added, lets say where a costumer, Peter Pan, asks for 10 buckets of Beige color paint. For each bucket there will be a child file in the Cubetas table and for each step in the mixing process there will be a file in the Detalles table. SO most of the action will take place in the Grandparent and Grandchild tables. the child table only receiving data from the other two. My question is: is it possible to have an action with a button in “Pedidos” (table 1) that would direct me to table 3 (“Detalles”)?

For this purpose I need a formula to filter the list of basic colors. I already managed to have them narrowed down so that instead of the 12 colors I have in stock, only the 3 or 4 needed in the particular formula “Beige” show up. Now I need to have that filtered down so each time a color is “completed” it dissapears.

Lets say, I am working on bucket 1 of Peter Pan’s order. I have to mix 4 colors: Black, White, Yellow, Red. I start with white till the requiered amount, so in my app now only black, yellow and red pop up; after adding black, only red and yellow are to be seen. Of course that means I am staying within specs. Until all colors are done, no more colors show app, status of that bucket file changes to “done” and I cannot add any further. So when I tap on “Next” or “new” (whatever I name that action) instead of opening a new file in that mix, a new mix (bucket 2) is started. Again paint options narrow down until bucket 2 is done and app directs me to bucket 3.

What is it that I need exactly? A loop series? Btw, I have not been able to do the second part of narrowing down the color options. My guts tell me the formula should go somewhat like this:

AND(

(First part already solved)SELECT(Colbas[Id_Color],(CONTAINS([ID_CUBETA].[ID_CUBETA].[Combi], [Id_Color],

(second part) SELECT(DETALLE_CUBETAS[COLOR],AND(

[ID_CUBETA],[_THISROW].[ID_CUBETA],

[%TAJE]<0.99)))))

Where [%taje] is a percentage of the real mix divided by the original mix from the formulas table. However I cannot make Appsheet accept that expression as valid. Maybe to many “selects”, maybe to many “ands”, maybe both. Anyhow, I want to see only the colors if:

  1. they are needed for the particular formula and
  2. if they are in the formula but have not been added as to fill at least 99.9 of the formula within that particular bucket.

I appreciate any ideas I can use

update: I managed to have it so that it now shows “data is not valid” if I select an option that I want to have shut off. It is an advance but not what I need.

Please try below and please update if and how it works. It may still need some more adjustment , even if it works.

SELECT(Colbas[Id_Color], CONTAINS([ID_CUBETA].[ID_CUBETA].[Combi], [Id_Color])) -

SELECT(Detalles[Color], AND([ID_Move]<>[_THISROW], [ID_BUCKET]=[_THISROW].[ID_BUCKET], [%TAJE]>=0.99))

Edit: Corrected some typos in the expression.