I have a table that displays data. Specifically, employee_ids.
When I select a row in the table component, an employee_ids field in a form will be populated with the employee_ids from the selected row data.
The employee_ids field is populated correctly.
But here is what I want to do...
- Allow user to remove employee_ids in the record. (This works)
- Allow user to select other employee_ids BUT only employee_ids that are not already contained within the table component itself. In other words, if employee_ids exist in one row in the table component, they cannot be added to another row.
I have tried to Disable the option in the multi-select component from being selected using the following logic:
{{teamTable.data.employee_ids[i].includes(item.employee_id)}}
but this results in only Disabling the first option in the multi-select (which causes #1 above not to work.)
I also tried {{_.includes(teamTable.data.employee_ids[i], item.employee_id)}}
but no luck.
Any help greatly appreciated!
Here is what the array of employee_ids looks like
then only getting the first array
![Screenshot 2023-05-24 at 2.24.51 PM](https://community.retool.com/uploads/default/original/2X/9/99bc6884e9bb442d9e035888133d62e545a93956.png)
then the first ID in the first array
![Screenshot 2023-05-24 at 2.25.02 PM](https://community.retool.com/uploads/default/original/2X/a/ab487bf6a5e3aa74644f3247a0a9f919ea0b17a2.png)
So even when attempting to iterate in the Disabled field using
[i][i]
like so:{{_.includes(teamTable.data.employee_ids[i][i], item.employee_id)}}
![Screenshot 2023-05-24 at 2.27.11 PM](https://community.retool.com/uploads/default/original/2X/4/44ed0c76c11b3d301707a9c66f5d0b7424d62786.png)
It does not work.