Permalink to Component

I would like to be able to permalink to a component that's below the fold from another app.

utils.OpenApp doesn't look like it supports taking a component ID as an argument.

I had tried to manually append a #retool-widget-container1 to see if the UI would scroll a component into view, but that doesn't seem to work. I'm looking for suggestions on how to implement this behavior. There are many apps in need of this functionality, so I'm trying not to have to copy paste scripts around to support this behavior.

For that other app, when it loads you can use the scroll to function - so that should work - you should not need to pass the component ID

Would you mind describing how all the pieces work together?

App 1 needs to do what?
App 2 needs to do what?

Thanks!

App1 - I used a link to go to another app in a new tab (doesn't have to be a new tab)
Screenshot 2024-03-21 at 2.33.52 PM

In the app that is opened in new tab, I created an empty resource query (can't use Run on page load for a JS query )
In the empty resource query I set it to run on page load under the advanced tab(query needs to be set to run when manually triggered) and then also set a Success event handler to control the component and scroll into view.

Screenshot 2024-03-21 at 2.36.24 PM

Thanks for sharing! I get what you’re doing.

There are a few shortcomings with this approach.

The main issue is that I wouldn’t want the scroll into view to run any time someone visits the app, only when someone clicks the link which is targeting a sub section of the greater app.

To achieve the above I now need to include some url param, or hash, or local storage, etc. to conditionally scroll and to conditionally view the right component.

In my original message I mentioned there are multiple pages that would need this capability.

This means I need to copy paste query param config across n apps + the scripts to scroll into view on all pages that require this functionality. It feels like a lot for what I believe is stock browser behavior using well named ‘a’ tags and a url hash.

Hoping there’s a general purpose, low lift solution.

You should be able to pass the component name as a param and then in the app the user goes to use that param in a Run script success event handler so it could be different for each app

Okay yep. You and I are on the same page. I am aware of how to make the mechanics work for that solution.

1 Like