25
Views
3
Comments
Need help with getting a filter condition working
Application Type
Reactive

hello, i asked a question previously on how to filter and display dishes of a restaurant logged in.

the project has more restaurants registered and each restaurant has its own dishes and i was trying to implement an order management app same in as the outsystems order management app project.

At the point of adding a dish to the order using popup form, the dish list drop down displays all dishes of other restaurants in a particular logged in restaurant and i want to prevent that, i added a filter to the dish to display dishes of only the login restaurant but still did not work for me.

attached is oml

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

Please provide next time in a question a more meaningful title.

"Need help" I'd not summering your question. I will edit the title.

You also refer to a previous question you posted, please provide the url for reference.

Regards,

Daniel

2024-09-17 18-14-33
Miguel Defavari da Silva

Hello!

I see you use the GetDishes.List aggregate to populate the 'Dish' dropdown:

And this aggregate doesn't have any filters in it, I can't test the following solution because I don't have the GENIUSDBMS module, so the dependencies are broken.

But I think if you add a filter to this aggregate your problem will go away. 

Maybe filter the users table by the logged in user? (As in the image below)

Sorry if I'm not making sense here, I got a little lost in your application's data modeling.

I hope this helps you!

Best regards,

Miguel

2020-07-02 13-32-59
Max de Groot

Hi Jacob,

Assuming you have a (static) table that holds the different restaurants, you could create a mapping to table between restaurants and dishes. This is done to create the many to many relationship (restaurant has multiple dishes and a dish could (potentially) be served in multiple restaurants)

When you want to fetch the dishes for a particular restaurant, start from the mapping table and join dishes table and filter by selected restaurant Id. This will only show the dishes of the selected restaurant.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.