Navigating to a sub-page

Hi,

I have a “Reports” page, displaying a list of reports. The url is “mydomain/reports”

By clicking any report, I would like to open that report on a sub page, making the url look like
“mydomain/reports/642784” (the number is the report’s ID).

** I obviously don’t have a dedicated page for every report. The data of the specific page needs to be sent to a single sub page.

This structure is crucial since this link will be shared outside the app, and users would be able to navigate to it directly.

How can this be achieved?

Any help would be much appreciated :pray:

@djtochner

Thanks cmarchan, but this is not the case. I want to open a page under the current one

@djtochner

Setting the destination page to the object you need (report) will achieve this:

www.domain.com/report/123
www.domain.com/report/456
www.domain.com/report/789
etc…

Just send the object using go to page from the origin page

That’s the easy solution :slight_smile:

I would like to send data from a REPORTS (plural) page that is showing a list of reports and is structured differently from a single report page, to a REPORT page that is showing just one report. This page should be a sub-page of the REPORTS page

Hi @djtochner,

I’ve used this configuration before: Instead of using a subpage, you can use 2 groups. Use 1 group for an overview of reports (f.i. a repeating group) and a group for the report details. Make the group report details is not visible on page load:

image

When you click on a report title in the repeating group, add the report ID to the URL using the “go to page”-action:

Then use the “page is loaded” event together with a couple of actions to hide/show the relevant groups:

First get the report id from the urlinto a custom state “id” using the logic in field Value below:

image

Second, as long as a user has not clicked on a report title the custom state “id” will be empty so use this to show/hide the repeating group Reports and group Report Details:

image

You can use this same logic to show/hide the group with the details for a report

The result is that when the page is opened you will see a report overview (notice the URL):

image

And when a report title is clicked (notice the URL):

Notes:

  • Make sure to activate “collapse group when hidden” in the settings for the 2 groups.
  • You might want to look into slugs instead of the report Ids.
  • Instead of groups you can also use the example above to go to a specific report page.
  • When you want to show the repeating group again, simply use a set state action to empty the state “id”.
1 Like

Thank you! Works like a charm :slightly_smiling_face:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.