How to get, in Toddle, the equivalent of filterByKey(BigArray, 'name',map(SmallArray,'value'))
Laetitia | Pinshasa
1 month ago
Dec 5, 2024, 5:00 PM
I'm trying to get a subset of a list of products, Toddle AI tells me to use filter and match and map, but I can't figure out how to properly use all three (in particular: where to insert "Matches") In the image, - BigArray = Products, - SmallArray = Product - the node Size is just to check the output (the array should be of 4 items, but I still get 290 as output - so nothing is filter) (PS : I tried before with includes, etc. but as my database doesn't provide a common id for each item of the SmallerArray, it can't work with a simple Includes here)
Lucas G
1 month ago
Dec 5, 2024, 7:10 PM
It would help to know how the data is structured
In your screenshot, map wouldn't work
The filter node expects a bool response for the formula
Lucas G
1 month ago
Dec 5, 2024, 7:12 PM
Use map to create a new array from your data
Filter is used to filter out items that match a certain formula