Hi! Hope someone can help me, been struggling for days. I am trying to make an event that will check if an object already exist within an array based on an item_id, delete it if it exist or append it if it does not. The purpose is to collect all items that are selected in an array that will be sent in the body of an api. I am not sure if this is even the best way to do it or not. Any help or feedback is greatly appreciated! Added a screenshot of my current formula. I am able to append and delete, but the deletion is super random and not the element I clicked..
Hi Jacob! I see, thanks for the tip. I tried using Filter, but couldnβt wrap my head around it. I just managed to do it now, donβt know if itβs the correct way, but it works. I am using Find.. π€·π»ββοΈ
Jacob Kofoed
5 months ago
Find only returns a single value. Filter works by running a formula on each item in the array. You could then do a comparison or other calculation on each given item. Only truthy values will be on the output array. There should bebe some videos on the filter formula.
Suavius
5 months ago
Oh, I see. Then I will take a look to see if I can find some videos. Been watching a ton of them and they are awesome! ππ»
Tod
5 months ago
Great energy @Suavius! Your continuous contribution to the toddle Community just made you advance to Community Level 1!