Hi everyone,
I am trying to filter out the options from one SharePoint data component which is inside the data grid component. In my SharePoint data component i have used an excel file where i am displaying numbers lets say from 1 to 30. Moreover, the user can have multiple values in it. For example, the user selected 2, 4 and 6 numbers from first row of data grid component from the SharePoint data component now what i want to achieve is that in the second row of data grid component in the SharePoint data component those three numbers (2, 4, 6) should not be displayed. How do i achieve this any suggestions would be useful.
Many thanks!
Hi @Anonymous
To achieve what you are describing you will need to use the "Filter Query" setting in your SharePoint data component to filter out records which have already been selected in your data-grid. You can use a filter like the one below, however you will need to modify it to fit your specific form.
let selectedValues = [] // Loop through the data-grid and track which items have already been selected data.dataGridName.forEach(r =>{ const selections = r.spSelect.map(s => s.NumberColumn) selectedValues.push(...selections) }) show = !selectedValues.includes(item.NumberColumn)
Hi @Anonymous
To achieve what you are describing you will need to use the "Filter Query" setting in your SharePoint data component to filter out records which have already been selected in your data-grid. You can use a filter like the one below, however you will need to modify it to fit your specific form.
let selectedValues = [] // Loop through the data-grid and track which items have already been selected data.dataGridName.forEach(r =>{ const selections = r.spSelect.map(s => s.NumberColumn) selectedValues.push(...selections) }) show = !selectedValues.includes(item.NumberColumn)