We ended up deprecating an end point and I need to change the retool apps which used this end point. I couldn't find a way to determine which apps used the endpoint. I had to go into each application and manually review the Resource being used for the queries there.
It would be really helpful to have a way of seeing which apps a Resource is being used.
Same here. I went ahead and deleted a few resources in hope they are not needed.
Is there any way to see this without clicking through all the apps and all their queries? Is there some way of "exporting all apps" so I could at least grep in some kind of json file?
At the moment that isn't a built-in feature though it has been requested a coupleoftimes so you're definitely not alone in wanting it!
Both displaying all apps that use a particular resource and having an endpoint for listing existing apps are on the dev team's radar. They haven't been picked up as projects yet but if and when they are included we can report back here!
Unfortunately for Cloud users, you'll still need to manually export your apps individually from your Retool home page (as of version 2.107.1).
For folks using self-hosted Retool, the following query can be used to check the on-prem database for which apps use a particular resource. It can be good to save in your query library to make it easier to input the required variables:
with most_recent_saves as (
select
*
from (
select ps.*, row_number() over (partition by "pageId" order by "updatedAt" desc) as rs
from page_saves ps
) ps_ranks
where ps_ranks.rs = 1
),
resource as (
select r.name as uuid from resources r
left join resource_folders rf
on r."resourceFolderId" = rf.id
where r."displayName" = {{resource_display_name}} -- plaintext name of the resource, must match exactly including whitespace
and rf.name = {{resource_folder_name}} -- plaintext name of the resource folder; if resource is not in a folder, use 'root'
),
pages_with_resource as (
select *
from
most_recent_saves
where
cast(data as text) ilike (select concat('%', resource.uuid, '%') from resource)
)
select
concat(f.name, '/', p.name) as app_name
from pages_with_resource pwr
left join pages p
on pwr."pageId" = p.id
left join folders f
on p."folderId" = f.id
**Note** It's not advised to make changes directly to your storage database as a lot of the values are interdependent, be super careful if you consider doing so!
Hey folks! As of 2.116.0 you should be able to see a list of apps using any particular resource and be alerted if a resource is in use when you delete it