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 / Form Only Displaying I...
Power Apps
Answered

Form Only Displaying Items in Gallery Title or Subtitle When Using Record Variable

(0) ShareShare
ReportReport
Posted on by 1,104

Hi,

 

I am using a parameter to deep link to a gallery item in my app. This requires me to use a variable for the gallery navigation.

 

So for the gallery, I have the OnSelect set to:

Set(varParamNav, Gallery1.Selected)

 

Which should set the variable to be the entire selected record.

 

Then for the form Items property I set it to:

varParamNav

 

So selecting an item in the gallery should set the variable as a record, and the form should read that record. However, the only thing the form reads is whatever fields are in the gallery. So if I have Name and Age as Title and Subtitle in the gallery, those fields display on the form. If I change Age to Created On in the gallery, then Age will be blank on the form, but Created On will display the correct value.

 

I've disabled all the OnStart formulas, I've tried creating a new screen with a new data source and replicating it there in isolation, but it still doesn't work. Which is strange because simply setting a record to a variable and using that variable as the Item on a form works in any other app I've built.

 

At this point I would even appreciate troubleshooting ideas, because I feel like I've exhausted all of them.

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    Instead of using a variable, try using a collection.

    ClearCollect(colParamNav, Gallery1.Selected)
  • SeanHenderson Profile Picture
    1,104 on at

    @Pstork1 

     

    I tried that, but unless I am mistaken, you can't use a collection as the Item property of a form.

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    You are correct that you can't use a collection as the item property of a form since its expecting a record.  But you can use First(collection) as the item property of a form.  That is the first record in the collection.

  • SeanHenderson Profile Picture
    1,104 on at

    @Pstork1 

     

    Thank you, that works for the navigation of the gallery.

     

    However, it is not navigating to the proper gallery item on start. The gallery item is build into an email using the web link ending in:

    &ParamNav="&Gallery1.Selected.Entityguid

     

    The OnStart is set to:

    If(!IsBlank(Param("ParamNav")), ClearCollect(colParamNav, Lookup(Entity, Entityguid=GUID(Param("ParamNav")))))

     

    I also tried:

    If(!IsBlank(Param("ParamNav")), ClearCollect(colParamNav, First(Filter(Entity, Entityguid=GUID(Param("ParamNav"))))))

     

    When I open the app using the generated link in the email it just opens to the first item in the gallery, rather than the item the email was sent from.

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    If I follow what you are doing I think you are going about it the wrong way.  The Form is now built to display whatever is selected in the Gallery.  So onStart you need to set the selected property on the gallery to point to the record that matches the parameter.  Setting the Collection will set the Form, but then be overridden when the Gallery defaults to the First record.  So you need to set the default property of the gallery to point to a variable and then set that onStart set that variable equal to the record you want to be the selected record based on the param

  • SeanHenderson Profile Picture
    1,104 on at

    @Pstork1 

    You mean the Default for the gallery to:

    varParamNav

    and the OnStart to:

    If(!IsBlank(Param("ParamNav")), Set(varParamNav, LookUp('Hazard Reportings', 'Hazard Reporting'=GUID(Param("ParamNav")))))

     

    Is that right? I have a timer that controls the navigation to the details screen with OnTimerEnd set to:

    (If(!IsBlank(Param("ParamNav")), Navigate(DetailHazardReport, Cover)))

     

    It goes to the details screen, but doesn't display any data (getting your data...) and if I click the back button to return to the gallery, it immediately returns me to the detail screen.

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    I would try removing the timer driven navigation until you are sure the gallery is showing the right selected record.  Then you can see about re-adding the direct navigation.  But you are on the right path.

  • SeanHenderson Profile Picture
    1,104 on at

    @Pstork1 

    So here's how I got it to work. I would love if you could audit my steps and see if I made things more complicated than necessary.

     

    All of the previous navigation around the gallery using a collection is the same.

     

    For OnStart I set it as:

    If(
     !IsBlank(Param("ParamNav")),
     ClearCollect(
     colParamNav,
     LookUp(
     Entity,
     Entityguid = GUID(Param("ParamNav"))
     )
     )
    );
    If(
     !IsBlank(Param("ParamNav")),
     Set(
     varParamNav,
     LookUp(
     Entity,
     entityguid = GUID(Param("ParamNav"))
     )
     )
    )

    Default of the gallery is:

    varParamNav

     

    I added a timer to navigate to the details screen. It's OnTimerEnd property is:

    If(!IsBlank(varParamNav), Navigate(DetailHazardReport, Cover))

     

    and on the Back button on the details screen the OnSelect property is set to:

    Navigate(BrowseHazardReports, Cover); Set(varParamNav, Blank())

     

    Everything seems to be working that way. Thank you for your help!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard