Help to filter a choice component from screen values

I’m pretty sure I’ve done this before in the old glideapps but for some reason can’t get this to work in the new glideapps.

I have an app that creates different logs of works in a ceramic studio.
fx on this date i creates ceramic X in X amount and I created ceramic Y in y amounts…

Roughly there’s an overarching main log (I call this table mainLog) with a date and other details and then there are log lines that connects to this overarching log which is mainly ceramics names and their quantities.

I have quite a long workflow to create the mainLog. I run it in a separate table called “Log Helper”.

When they get to the last step in the workflow log helper a new row is created in the mainLog table and the user is presented with a button to add different ceramics with their quantities.
I have a button in the logHelper that lunches a formscreen.
The destination of the form is set to logLines.


However I now need to filter the ceramics dropdown based on some parameters from the logHelper. I imagine I could use some values from the screen, however it only shows values from loglines, which is the table where the form is inputting data.

Is there something I’ve completely misunderstood with screen values?
Should I be doing this in another way?

I think what you see is correct, because as soon as you point your form screen at your LogLines table it switches context. The thing to do here would be to make use of your User Profile table for storing any values that you need access to from this form.

3 Likes

I think what I don’t understand then is what would I filter from my LogLines as the record is not yet created?

The only thing is I’ve defiantly done this before in my old glide apps (As I’m converting an old app to the new ones). Is it something they could have made different between the two?


I guess I could just have some columns in my User table which the The LogHelper fills out when it creates the MainLog and filter that way around.

I think I’m missing something.
Which table is the source of your choice component, and what are you wanting to filter it by?

2 Likes

Hi @Darren_Murphy

I’ve created the below, I don’t know if this will make things easier?

The source of the choice component is Ceramics Table.

I want to filter two things:

Filter 1 - filter out ceramics that does not have the log process selected.
I need the user only to be able to choose the ceramics which has the logging process selected in its multiple select field. This is currently stored in the LogHelper when column values are set when clicking on the grid component.

Filter 2 - filter out already logged ceramics
When users creates more loglines in the same under the same MainLog I don’t want them to be able to create more of the same ceramic under the same MainLog.
fx if they glazed 5 bowls I don’t want them to accidentally be able to create another logline in the same MainLog with another 10 bowls.
I belive that I can filter this based on the auto generated unique identifier (Which becomes the ID for MainLogs) which is also stored in LogHelper.

But when I try to filter I can’t access any data in LogHelper only in values from screen. However I did this back in a classic app above, which is following the same work flow.

  • Is it something I’m missing?
  • A bug?
  • Different ways og doing screen values from “Old” GlideApps and “new” GlideApps?

Hi,

Filter 1 - filter out ceramics that does not have the log process selected.
I need the user only to be able to choose the ceramics which has the logging process selected in its multiple select field. This is currently stored in the LogHelper when column values are set when clicking on the grid component.

Would a relation between your ceramics table and your helper table work? If you store some information about selected ceramics in your helper table you can relate this columns to the ceramics table. Then if the relation IF NOT empty, don’t show this ceramic in my choice component.

Filter 2 - filter out already logged ceramics
When users creates more loglines in the same under the same MainLog I don’t want them to be able to create more of the same ceramic under the same MainLog.
fx if they glazed 5 bowls I don’t want them to accidentally be able to create another logline in the same MainLog with another 10 bowls.
I belive that I can filter this based on the auto generated unique identifier (Which becomes the ID for MainLogs) which is also stored in LogHelper.

We could apply a similar logic here, but on opposite way, IF the relation DOES NOT contains the ceramics, then display.

I haven’t fully grasp the user workflow so I’m not sure, don’t hesitate to tell us!

2 Likes

The problem my choice component is on a form screen that writes to the LogLines table - which is only initiated from the LogHelper. I also thought I could make a relationship between the ceramics table and the LogHelper, however I can’t access any values from the LogHelper when filtering my choice component in the form screen.

1 Like

Ho I see, when you add Loglines, you’re not in the Helper table anymore but in a form screen adding to the Loglines? It means that when you create your log lines, they are automatically linked to the created mainlog?

Then I guess that you would have to:

  • Create a relation between your Ceramics and mainlog table, in order to know in which mainlog your ceramics have been added.
  • Then in your form loglines (as it’s linked to your mainlog from what I understood?), you can put a filter in your ceramics choice component saying, IF your relation between your Ceramics and mainlog table CONTAINS the current mainlog, THEN don’t display it.

Would it work with your current tables?

1 Like

In the end I just did what @Darren_Murphy suggested and put everything into the user…
But thank you @Lucas_Malguy1 for staying with me on this.

1 Like

Perfect then!

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