I'm filtering a table but I get max 20 results in ...
# 🤝help
f
Hi! I am building a chatbot for my institution. I managed to incorporate a table that has the register of the projects available for students to participate on, the list of majors that can apply to each of them and additional data. The columns are the following: APUESTA (this would like the category), PROGRAMA (The program each project belongs to, there is more than one project in one program), AREA, CODIGO PAP (the project code), PROYECTO (the project) and finally CARRERAS (the careers or majors that can apply, but this column is a string, but the content has the format of an array of majors cause I use a big CSV and put it through a script beforehand to get the array of careers that can apply to each project but there is no Array datatype in the tables) In the workflow I ask the user if they want to get the list of projects they can apply, then if they're from engineering and then take them to a dropdown with all the available majors (they show up just like they show up in the table to be more precise) I then filter the table with the filter table card, to select where the user_career is found within the column of careers and get an array, then give it format with AI task to show a list of the project with their code (A lot of context I'm sorry, just want to be as specific as possible to make it easier to understand what's behind) The issue I'm having is that the array gets tops 20 results, but there are majors that can apply to around 30 projects, I never get more. There are a total of 84 registers(projects) in the table I also tried the execute code to get everything more precise and all the records (since there are careers that are similar such as DISEÑO and DISEÑO INDUSTRIAL, but aren't the same) but I'm getting to output. Really hoping I can get some help 😭 https://cdn.discordapp.com/attachments/1227304648034222213/1227304648864432269/image.png?ex=66312606&is=661eb106&hm=c6dbb78da66b53227656f4e3a9f58267a123194c78ae9d2e3b41c49ed97021d6& https://cdn.discordapp.com/attachments/1227304648034222213/1227304649305096303/image.png?ex=66312606&is=661eb106&hm=21b1dafe192a8a2a4dff23d7503138e25c2f62a5bb52201092f5051978f7d158& https://cdn.discordapp.com/attachments/1227304648034222213/1227304649715879947/image.png?ex=66312606&is=661eb106&hm=cab46be143af4d5d95f2b0715996ee227aa1ec3b2dd106df4ad73fb3ba4cb747& https://cdn.discordapp.com/attachments/1227304648034222213/1227304650248814633/image.png?ex=66312606&is=661eb106&hm=b012016714d6f5d45fe080d57c0333349ef870fe5ebeadaae08ca739ea549da9& https://cdn.discordapp.com/attachments/1227304648034222213/1227304650688954368/image.png?ex=66312606&is=661eb106&hm=f4c3dab5a7bce79fa7b69cac96f82c08c37dbc00fa029628b8707b7ce6472a7b& https://cdn.discordapp.com/attachments/1227304648034222213/1227304651070898276/image.png?ex=66312607&is=661eb107&hm=390ef18a11affaae9fe09c9de9b2aeba3b6d2dca10c3957e730f3e5cc5e0c152& https://cdn.discordapp.com/attachments/1227304648034222213/1227304651498459176/image.png?ex=662742c7&is=6625f147&hm=046048c9063cadb7d1c65f07c757055c3b0594eb293e8b1375b22ec21e326144&
This is the code in the execute code, it's built with the AI giving a very similar prompt as the filter table
Copy code
const carreras = await O2024Table.findRecords({
  filter: {
    Carreras: { $in: workflow.carrera_usuario.split(',') } 
  },
  group: {
    PROYECTO: 'key',
    'CODIGO PAP': 'key'
  }
})

const filterResult = carreras.map((record) => ({
  proyecto: record.PROYECTO,
  codigoPAP: record['CODIGO PAP']
}))

workflow.resultado_filter = filterResult
r
can you show us what
workflow.resultado_filter
contains? ie. how many elements are there?
r
can you change the filter code to
Copy code
{"Carreras":{"$regex": workflow.carrera_usuario}}
assuming
workflow.carrera_usuario
contains only one carreer
f
still 20 max
for the one I'm using to test there should be 32
r
Can you remove the group by just to be sure ?
Also, can you add « limit:100 » to the find
f
I got the 32 records!!
Copy code
const carreras = await O2024Table.findRecords({
  filter: {"Carreras":{"$regex": workflow.carrera_usuario}},
  limit: 100
})

const filterResult = carreras.map((record) => ({
  proyecto: record.PROYECTO,
  codigoPAP: record['CODIGO PAP']
}))

workflow.resultado_filter = filterResult
f
Sylvain is the best CEO!🦸‍♂️💎
f
Yeees, I've been pulling my hair for hours Thank you so much 😭 💕
r
Glad I could help! 😄