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 / Detail Form does not w...
Power Apps
Answered

Detail Form does not work - errors with Gallery.Selected

(0) ShareShare
ReportReport
Posted on by 206

I am building my first app which was based mainly from a single SharePoint List called "Student List". This was created using the automated process.

 

I have had few issues with the Gallery page, but I when I went to edit the Detail page, it was broken. I have tried to look everywhere for solutions, but I have not found anything to help with the problem. My main resource that I have been trying to follow is Understand canvas-app forms - Power Apps | Microsoft Docs.

 

My problem: the 'Item' on the DetailForm should be 'Gallery.Selected'. However, I get an error. I have tried to attach any images that might be useful. 

Image 1 - Gallery View:

- The gallery is called "Gallery".

- The arrow to the next page has a function to navigate (as shown).

- I previously tried making the arrow "Select(Parent)" with no success (I don't know what is correct, just that the 'Understand canvas-app forms' documentation say do 'navigate').

J_Taylor_0-1624961159541.png

 

Image 2 - Detail View:

- The form function for the Item is "Gallery.Selected". This comes up with an error stating: "Invalid formula: expected a value compatible with 'Datasource'".

- The Datasource can be seen. It is the same as the Filter function from the ListSearch.

- I have also tried [@'Student List'] for the Datasource. 

J_Taylor_1-1624961413318.png

 

Any help or advice would be greatly appreciated. I apologise that I am quite new to this and one may need to 'dumb it down'. 

Categories:
  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    It's not a good practice to use Gallery.Selected, do this:

    Set your gallery's OnSelect:

    Set(varRecord,ThisItem)

    Set your form's item property:

    varRecord

  • J_Taylor Profile Picture
    206 on at

    Zmansuri, thank you so much. You saved me hours more time spent on research. 

     

    As an optional question, why is the Gallery.Selected (and, I suppose the Parent(Select) with it?) 'bad practice'? Is it just because it doesn't work or is it actually 'wrong'?

     

    Thank you, again!

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Its not wrong. But as you see it sometimes work sometimes doesn't. So better not use it

  • J_Taylor Profile Picture
    206 on at

    If I may ask another question (also optional):

    In a card, how does the value work with the formula "Parent.Default"? The card has the default property of "ThisItem.Year" - which is understandable. Does "Parent" literally refer to the item it comes from?

    J_Taylor_0-1625010071257.png

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Every field of databse has it's own data card. Parent is the datacard which that control is inside.

  • J_Taylor Profile Picture
    206 on at

    Thank you so much for all of your help!

  • kaushalpatel257 Profile Picture
    on at

    Zmansuri, I have tried that out but when I select Edit or View Button then it shows 'No item to Display'. I was using Gallery.Selected in Items on Form Screen but as now I have changed and made new Gallery, it stops working now and giving me below error.

    kaushalpatel257_0-1656551392873.png

     

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 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard