can I do async custom functions?

I have a custom function that takes a places collection, sorts/checks the documents and adds the ones I want to a list to return. This works, but I'm trying to add a check for data in a subcollection of places. I have the code running, but while debugging it I found it's not working as expected because the call to the subcollection is an async call and returning a Future object and thus isn't completing before I check the data it should return. ChatGPT says to add async/wait to the function to address this, but I can't get FF to accept that.

I can give more details if it helps, but for now I'm just trying to understand what my options are here. Can I use async/await/future stuff in FF custom functions?

Thanks for any guidance.

5
18 replies