passing values between pages

  • immaculate_tiger_15139-1360220869443453048

    Kai

    17 days ago

    Hi,
    I have a question about passing values.
    I have an overview page /members with a list of users. For each user, the name, email address, and a "view profile" link are displayed. How do I pass the user_id to the /profile page so that I can pass it to the Xano API?
  • lucasg-1360221492209520770

    Lucas G

    17 days ago

    As a URL parameter would be the easiest option.
    Alternatively you could use session storage
  • immaculate_tiger_15139-1360223727970811954

    Kai

    17 days ago

    Thanks @Lucas G for the respond.
    Means I have to add for exampel "?user_id=10" at the end of the URL?
    And how do I access the URL parameter on the profile page?
  • lucasg-1360238942204592168

    Lucas G

    17 days ago

    Yes that’s correct
  • And you can access it by adding a query parameter to a page
  • Or by passing the current page’s URL
  • I recommend the first option
  • You’ll see in pass settings the option to add path and query params
  • immaculate_tiger_15139-1360276484144500928

    Kai

    17 days ago

    Lukas, I only got it half working.
    I created a query parameter "user_id" in the URL settings of the member list page.
    In the repeater loop of the users, I assigned the respective user_id correctly from the item and set up a click event on the button to navigate to the /profile page. That part works.
    But when the /profile page is opened, the ?user_id is empty. Sorry, I don't understand where the mistake is.
  • filip_dajkovic-1360282520221909073

    Filip Dajkovic

    17 days ago

    You need to concatenate that user_id query parameter to the path when you're redirecting
    1360282520188620800-CleanShot_2025-04-11_at_17.56.182x.png
  • dfeinberg5-1360288201734098995

    Danny

    17 days ago

    @Kai nothing wrong with what you're doing at all, but wanted to share another common approach.

    * You could have a Members page /members
    * Then you could have a Member Detail page /members/:member_id where the member_id is a path parameter
    * From the Members page you can have a link with an href /members/12345 where 12345 is the user's Id as you repeat through the list
    * Then on the Member Detail page you can access the path param member_id and pass it to your API to fetch the corresponding data
  • immaculate_tiger_15139-1360349733532467441

    Kai

    16 days ago

    A little change and worked. Many thanks guys!
    👍1