Bit of a newb with custom code. I want to do a super simple query where I pass in a UserRefDocument and it returns a count of items in a collection with some custom criteria.
When I try to use a custom function, I keep getting debug errors about the query needing to be async, and my trusty friends ChatGPT suggest I use 'Future" in my custom code, but anything I try using Future in a custom action doesn't seem to work.
I saw in another thread that custom actions are a way around this, and I got it working great, but there's no neat way to run a custom action unless I do it "On page load, run this function, return the value then do something in the UI. This works, it does feels messy.
So what's the best way to do this? I feel like I'm missing some knowledge here.
Uhhh how to do Firestore Queries with custom functions vs. actions
3
6 replies