Reuse details view

Let's take for instance the demo app showing inventory of electronics components. The way it's wired is that the details view renders data from the List Collection's selectedItem. How ever if want to be able to reach the same details view from multiple places, or e.g. from a search, it becomes unpractical to have it reference a single list. What's my alternatives here?

Try using an event handler to set a temporary variable.

Hey @Theo! As @w2go mentioned, a temporary variable could definitely help here. I'd also be happy to help you set up your app if you have any specific sticking points :slight_smile:

You can define a standard format that your details view uses. One analogy for this is API. Take any API as an example, you must pass in the data in the right format (data type, property names,...) in order to trigger the endpoint. Same concept applies here, your details view can take in any data as long as it follows certain format.

Another good example is the select component in Retool. You have to the option to map any data to the select's data structure. So doesn't matter which data source, as long as you mapped it correctly the select will function as you'd expected.

Once the mapping is done, details view can be reused. Tools such as JS Query, Transformer, & Query JSON with SQL can be used to map to the right format.

1 Like

Thank you! Temp variable did the trick!

1 Like