web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Navigate to another sc...
Power Apps
Answered

Navigate to another screen with ID, tied to next screen ID

(0) ShareShare
ReportReport
Posted on by 49

Hi, I have a screen called "audit" with an audit_id PK from SQL Server.  I have other screens that are related to that same ID.  For instance, I have another screen called "audit_current" with an audit_current_id (matches audit_id from the main screen).  Since the ID numbers are all tied together stemming from the main audit table, what syntax do I use that pulls the current audit_id and opens the gallery on the new screen?

 

Navigate(screen_audit_current,selectedRecord.audit_id) ???????

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @mgd1317,

     

    The Navigate structure is as follows:

    Navigate(<ScreenName>, <ScreenTransition>, {<LocalVariable(s)>})

     

    Is 'selectedRecord' a variable name? If so, the following approach should work:

    Navigate(
     screen_audit_current,
     ScreenTransition.None,
     {locSelectedAuditId: selectedRecord.audit_id}
    )

    This will create a local variable in screen_audit_current named locSelectedAuditId.

     

    In case you need a variable across multiple screen it may be beneficial to use a global variable instead which can be referenced from any screen in the app:

    Set(
     gblVarName,
     //Replace with a reference to the record (Gallery.Selected, LookUp()...)
     RecordReference
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • mgd1317 Profile Picture
    49 on at

    Hi, the "1" is the audit_id from the main audit screen so when I mentioned selected value, it was just the one I chose from the gallery.  The "1" is used on each of the tables so for the audit_current, I would be navigating to that screen within the gallery of the audit_current screen, also a "1" if that makes sense.

     

    mgd1317_0-1709064665462.png

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @mgd1317,

     

    Saving that id to the next screen can be done within the Navigate function:

    Navigate(
     screen_audit_current,
     ScreenTransition.None,
     //Adjust to the correct gallery name & column name (will save the id)
     {locSelectedAuditId: GalleryName.Selected.audit_id}
    )

     

    In the next screen you could auto-select the record containing that ID by using a LookUp function in the Gallery Default property:

    //Default property (Gallery on the next screen)
    LookUp(
     //Change to the correct datasource (should be the datasource of your Items property)
     Datasource,
     //Change Id_Column to the correct column name
     Id_Column = locSelectedAuditId
    )

     

    Alternatively, If you only want to display records in the next screen's gallery that match that Id - use the following code in the Items property (Default can remain empty):

    Filter(
     //Change to the correct datasource
     Datasource,
     //Change Id_Column to the correct column name
     Id_Column = locSelectedAuditId
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard