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 / Trying to set Form Ite...
Power Apps
Unanswered

Trying to set Form Items from Component that includes a Gallery and an output of "Record" type

(0) ShareShare
ReportReport
Posted on by 17

Hi, I've created a component with a single gallery inside.  Input = table (working as expected), Output = record (label is componentGallerySelectedRecord ).

 

When I try and set my Form.Items = componentGallerySelectedRecord.SelectedRecord the hover over shows an error of type, "Invalid Formula - Expected a value compatible with the data source."

 

The data source being passed into the component TableXYZ is the same data source being used for the form.

 

I'd think I was passing back a pointer to a record (or the record itself) and thereby could set the item property on the form directly.  Instead, as a workaround, I have to do a lookup on a unique value (passed back from the component) in the Forms item property.

 

Am I missing something?  Why can't the SelectedRecord be passed out of the component and used directly to set the Form.Item?

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Brent-CSG 

    For the Item property of the form to work correctly using SelectedRecord or Galleryx.Selected, the Datasource of the form must match the datasource of the Gallery.  If the datasource of the gallery is modified,  then the Item property must be more specific, hence reason Lookup(Datasource, ID= Galleryx.Selected.ID).  In the Apps I develop, I always use this syntax to avoid the problem should I later decide to use a collection or modify the datasource in a gallery.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard