Best way to hide/display a reusable element depending on page parameters

My app has a specific page called “Activity” where the content of the page varies depending on which Activity the user is currently accessing.

I have set it up to use individual reusable elements for each Activity’s content, since they are all completely unique and quite complex with their own workflows. This seemed to be the recommended approach after reading this helpful post: A guide to advanced use of reusables

So my intended functionality is that the user clicks to view a particular Activity, which navigates them to the Activity page and sends the current Activity like so:

Screen Shot 2021-03-18 at 9.49.01 AM

When the Activity page loads, I need to hide all the reusable elements except for the one which is associated with the current Activity that the user selected.

The only way I can think of to do this right now is to manually code in the unique ID of the activity as the data source for the repeatable element like the below screenshot…

Screen Shot 2021-03-18 at 10.08.43 AM

…and then show a group containing the reusable element only when the page URL matches the reusable element’s data source:

Screen Shot 2021-03-18 at 10.13.33 AM

I also considered setting a custom state on page load and manually assigning each Activity to a number, and then whenever the custom state matches that Activity’s number, show the group.

But it’s effectively the same, manual process. I feel like I’m missing something obvious here but I can’t think of a better way. Is there a better way to approach this that is more dynamic, e.g. by somehow associating a reusable element with a particular “thing” in the database?

how many activities are there? I would consider using an activity type option set to specify the activity element that is required, as this can be stored on the activity.

There are currently about 25 activities but that number will always be increasing since we’ll continue to add more.

I’m not sure I quite understand how that would be better/different anyway though. Assuming I would have to create a unique “type” for each activity, and then I’d still have to manually set a condition like “when type is X, show this element” for every reusable element right?

Sure, but you only have to set that up once in the life of an activity. If you use options sets then you don’t need to perform a search.

Yea, I suppose that is a slight benefit. I’ll give that some thought and see if anybody else has any ideas. Thanks @nfisher