I have a table and form in an app. The table located left is the list of event and the right form is for the details of the selected event from the table.
Both table and form share same options. How can I make them share the same option lists?
It seems I can do it if I make an additional query, but actually I don't want to do that and I feel like there must be better solution.
Hi @chris910512
If you'd like to create the option list to use all values from the table, you can create an array of unique values by using the .map option. Here's an example;
{{ table1.data.map(item => item.website)}}
This will check within the data of table1 and find all unique website values which is then selectable within the select field. As soon as a new value appears within the table, the select component will be able to use that too. This will allow you to dynamically manage the select source array.
P.s. make sure to click on the 'fx' option within the 'Data source' field for the select component to use above code.
Let me know if this is what you're looking for!
1 Like
Hi RetoolPV,
I created this query and it seems it works well so far.
Thanks a lot!
{{ [...new Set(table1.data.map(item => item.job))] }}
Perfect, happy to be of help!
1 Like