How to add a toggle for URL parameters that's under resources

Hello,

I had a quick question. I have an export feature built within Retool and I have to fetch the data set based on a URL parameter which is set under resources. The data set is different based on the URL parameter, therefore, the export is different. In order to run the export for all data sets, I need to go into resources and change the URL Parameter manually each time. Is there a way to add this as a toggle on the edit page so I don't have to go back and edit the URL parameter every time. Attaching a screenshot below. Thanks!

1 Like

A couple of ideas:

If you want the option to get a single download with everything, my first thought is to have a second query that gets all of your datasets and have an export button for that.

If you want to be able to change the dataset without changing the URL, have that second query again, but have it filtered by something else like a temp state variable or Select Component value.

A variation of this would be to have a single query that looks to the URL for the query parameter if the temp state var is null, otherwise uses the temp state to get the query parameter.