I'm currently building an app which has to dynamically select the resource ID based on a select component.
Once I set the resource ID the GUI mode isn't available anymore and I'd have to setup the query manually.
But I already read here Insert into resource using SQL mode that bulk inserting isn't really possible through the regular SQL mode.
Is there an alternative workaround?
Could you post a screenshot or two to help us understand what you are trying to do and what isn't working?
When I'm doing a regular bulk insert / upsert / update with a static resource, I can just use the GUI mode, like this:
But as my app is used by users in different countries that have separate databases, I have built a language switch, which returns the retool resource id for each database.
Once I'm using the dynamic resource id, the GUI mode just disappears:
I read here: Bulk insert SQL mode. Is it possible? - #2 by ScottR that maybe I have to loop through my changeset with JS and trigger individual MySQL row updates from there, which could work, but isn't that efficient, I guess
That is odd. I guess you could build a GUI based insert for each individual resource and then trigger the appropriate one based on the language switch, but that also sounds terrible (and harder to maintain).
@ScottR & @lauren.gus - do you see your JS single row insert loop approach as the right approach here too? Is the GUI Mode disappearing when using Resource ID possibly a bug?
Creating multiple resource queries would be awful to maintain. I often not only have one single insert, but multiple. also when I add new countries with new databases I would have to update every app I use the language switch in.
Hey @alexdanylyschyn, correct GUI mode isn't currently available when using the dynamic resource selection. Looping through and triggering an insert query is currently the best option. I'll attach this topic to an internal ticket tracking GUI mode for dynamically selected resources and update you here as I get any additional information.