I’ve built an app that allows users in my base to select a record in a certain table. I’m using GlobalConfig to store the ID of that record.
However, when I first publish the app to my base I get an error because the GlobalConfig does not yet have an ID stored. So when do
useRecordById, I get an error like this: “getRecordById expects a string” because there is no record ID stored in GlobalConfig, since a user has not yet selected one.
When I tried putting
useRecordById inside a conditional, I get an error because you can’t put hooks inside a conditional.
What is the best way to get around this? Thanks!