cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Getting Error that Gallery.Selected is not compatible with datasource

Hi,

 

   I have created an APP that is connected to SQL. On my App Gallery I created a collection called "userCostCollection". I did this because I added a column called "displayname". This is because I wanted to sort and filter by this column. I used to add the column Addcolumns.

 

   Until here this worked great. But whn I click on the Selected item on the Gallery, the ViewForm seems to have an issue with this new added column. In the ITEM event the BrowseGallery1.Selected says "Invalid Formula: Expected a Value compatible with DataSource. The data source is a SQL table that does NOT have the Dipslayname. '[dbo].[UserCost]'.

   I tried to use on the "onVisible" of the edit form the DropColumns(userCostCollection,"DisplayName"); but this has not helped. If in the collection userCostCollection I don't add this column all works.... So what I have tried is to remove the column before it gets to the Edit of the form without success.... 

 

   Help is appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @drako 

The easiest way to resolve this issue is to modify the item property of your view form to look up the record by primary key ID, rather than to reference the selected item in your browse gallery. As you've discovered, this method will no longer work because the schema of the items in the gallery no longer match the record schema that the view form expects.

You would set the Item property of your view form to..

LookUp('[dbo].[UserCost]', PKField=BrowseGallery1.Selected.PKField)

 

View solution in original post

3 REPLIES 3
Super User III
Super User III

Hi @drako 

The easiest way to resolve this issue is to modify the item property of your view form to look up the record by primary key ID, rather than to reference the selected item in your browse gallery. As you've discovered, this method will no longer work because the schema of the items in the gallery no longer match the record schema that the view form expects.

You would set the Item property of your view form to..

LookUp('[dbo].[UserCost]', PKField=BrowseGallery1.Selected.PKField)

 

View solution in original post

Frequent Visitor

Hi @timl ,

 

   I have been at this ALL DAY and you made it work, creating variables, doing collections, changing, setting, updating!!!
   I'm so happy. Thanks!!! 

Kind Regards

 

Super User III
Super User III

Wonderful, glad you got that working @drako!!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,048)