I'm new to Outsystems and I'm still figuring out the syntax and ruling of the expression.
For context, I want to update multiple variables when a dropdown list was changed. My logic goes as follows:- Once the user selects an option, the value of that option (which is id in database) is passed to a variable. - Using onChange handler, I want to access a certain value in the database based on its Id and column name. The passed value will be used as Id and the column can be manually declared.- Retrieved value is passed to another variable.
After 5 consecutive shots of coffee and cursing that can make a sailor want to adopt me, I figured out a clanky but working method of filtering:
1. Input sends the system generated Id to local variable2. Upon clicking next, a client action is declared3. Form is verified and the following formula is used while assigning value to another variable: - Index the Id inside the database using "Index(//database.Colname//, //retrieved ID//)" - List all the data from database using "Get***.List" - Combine all functions: Get***.List[Index(**,**)] - Declare the database and the specific col of the data that needs to be retrieve: Get**.List[Index(**,**].//Database//.//ColNameWhile I use Index in this example, I end up using IdentifierToInteger just to make it usable for array.As much as I just want to automatically send the data to database, form type web needs multiple pages and submission control. So yeah very clanky.
Hi John,
You should include the local variable in the dropdown properties, then incorporate it into the aggregate filter to retrieve the desired data. Utilize the OnChange action of the dropdown to update the aggregated data with the added filter IDs.
This will fetch dynamic data from database based on values from the dropdown.
Regards,
Anjali
But the issue still stands, what syntax to use in order to use the id (sysgen id) from a variable to retrieve the 3rd column in the database. I need to separate the digestible data from functional data (system logic strings and ints), hence the need for multiple variable setup in 1 function.
Considering your doubts I strongly advise you to go through this training.
Hope this helps.
Nuno Rolo
1.Refer below link for to get more information about client variable
https://success.outsystems.com/documentation/11/reference/outsystems_language/data/handling_data/client_variable/
2.
Dropdown property window
variable:To store selected value of dropdown
List: List of the option shown in dropdown option
option text-show option text
option value-selected option value
option value,Variable will be same datatype
3.Refer below URL for get selected product detail
https://personal-3jlegpjt.outsystemscloud.com/poc/Dropdown?_ts=638521450998581800