How To Make a Data Table Selector That Uses Workfl...
# 🤝help
for example I want to do something like this, get all users with age > X where X is a workflow variable that the users inputs
Hey @numerous-parrot-82549, selectors are contstant (so far), but you can use a selector to get all the table's data, and then parse it in code. Here's an example: 1. I have a table of animals, and I make a selector that returns the entire table 2. Then, in code, I write a function to call that selector and then parse through the returned data to find rows that match with the provided data 3. The matches are returned, and then I say the results to the user Here's the code I used:
Copy code
const getAnimalsBySize = async (size) => {
  const animals = await AnimalTable.findRecords({ selectorName: 'get_all_animals' })
  const returnArr = animals.filter((animal) => animal.size === size).map((animal) => animal.animal)
  return returnArr

workflow.animals = await getAnimalsBySize(event.preview)

@acceptable-kangaroo-64719 thanks for your quick response! I am aware of such approach, I just think loading all data an filter on it is not very optimal, but anywy thanks for the advice! appericate it
Hey Energizer, I requested this feature in the features request tab. Sounds like we both want the same feature.