Hi, I need help making hobby selection/save dynamic per user using my own StaticUser table (not OutSystems Users / GetUserId).
Problem
Using a multi-select dropdown for hobbies (SelectedOptionList)
SaveOnClick is not working → data not getting saved
Data shows for all users instead of only the logged-in static user
I want each static user, when logged in, to only see and save their own hobbies.
Hello.
First, don't do this.
You are deleting one by one on the client side. You should send a single request to server side and do a truncate on the table.
Second, to save you need data. Empty attributes create empty records.
How are you defining which user get which hobby? That is not on the screen.
And it should also be done as a single call to the server.
I tried your suggestion, but it’s still not working for me. I’m not sure how to properly define which user gets which hobby when using my custom StaticUser table. Right now the SaveOnClick is creating empty records or showing data across users.
Could you please guide me on how to pass the selected dropdown values along with the correct StaticUserId to the server in a single call?
I also want that when a user refreshes the page, their saved hobbies should automatically load into the dropdown. The dropdown should always show the user’s current selections, so they can check/uncheck or add/remove hobbies anytime.
I fixed the Delete and Save/Refresh is working.
But every time you save it deletes again... You need to clarify what you want.
What I want is:
When a user selects hobbies from the dropdown, those selections should be saved and also displayed in the table below.
The next time the same user comes back (or refreshes), the dropdown should already show only that user’s saved hobbies as the initial/starting selections.
Right now, I’m using a variable (Var1) for this, but it causes an issue: other users opening the screen through the link can also see my saved data.
I only want each user to see their own saved data, so they can check/uncheck or change their hobbies independently.
Also, if the user removes a hobby from the dropdown (using the cross ✖️) and saves, the table should update too. After that, even if the user refreshes the page, the dropdown should still show the updated saved hobbies automatically (without needing to click the dropdown).
(See images attached)
So you don't need to delete.
What you need is to filter by logged user, but before you have a static user entity instead of the usual User entity. You don't know who is logged in. Why do you want the StaticUser to be like that?
Yes, you’re right I’m using StaticUser only for testing purposes right now, instead of the built-in User entity.
Can you please show me how this filtering and saving should be done in an OML example (even a simple one)? That would really help me understand the correct approach.
Here is a simple version with the real User table.
Didn't do the security part, just some save/delete logic.
Hi,
I want to build something like this in my OML, but right now I’m only able to save up to 2 roles. Here’s what I need:
Additional details:
The goal is that the user can select multiple hobbies and save them properly in the relationship table.
if you got the solution please mark as solution