What code syntax do I use to not proceed until a query has finished getting all rows? I have searched posts and think I have tried all suggestions but I know I'm missing something. The GetOrgsOfUser need finish before I scan through it to build the table. From what I have read I need it to execute in an async way but I have tried a bunch of different ways and can't get it to resolve before the subsequent code executes.
I'm not sure what you mean. I tried more than a few ways to use result in the map both inside the async func and outside. I most likely was getting the syntax wrong since every way I tried produced errors. I do need the jsCode to return the list as I want to use it further in the function outside of the async function.
So what I meant was that instead of taking the data to map over from the queries response (.data), which I assume isn't available yet by runtime, you instead take the immediate success-callback response of the query.
I just setup a demo and it looks like you won't even need the async and could do something like: