cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Invalid Formula. Expected a value compatible with 'DataSource'

I am facing an error when I try to build an Edit Form based on my Gallery selection, based on the SharePoint List "Opportunities and Risk".

 

In my gallery, named "BrowseGallery1", I have the following script in the "Items" field:

 

Filter('Opportunities and Risk', 'Entry Type'.Value = Label2.Text)

 

I configured by Edit Form, labelled "Form 1" Datasource:

 

'Opportunities and Risk'

 

And the Item field:

 

BrowseGallery1.Selected

 

However, I am getting error "Invalid Formula. Expected a value compatible with 'DataSource'". I believe I am already pointing the Form and Gallery to the same data source. What could be missing from my setup?

12 REPLIES 12

Worked perfectly, thank you so much! 

MJL1
Frequent Visitor

I think I might have discovered the source of this problem.  I haven't tried the workaround yet but presume that it will work.  I think it has to do with the nature of the datasource in the gallery that provides the selected value.  If it's a simple datasource, say, a dataverse table, the Gallery.Selected value seems to work fine.  If the datasource in the Gallery.Items attribute is something more sophisticated e.g. the output of a filter or search function, the Item attribute of the Display control seems to not be able to resolve the selection.

 

This was true of my scenario.  Here's the datasource in the items attribute of my gallery on a "browse" screen

Filter(
        Search(
        AddColumns('Regulatory Business Processes', "blah", PlainText('Process Taxonomy Level 1'))
        ,TextInput1.Text
        ,"bipr_name"
        ,"blah"
    )
    ,If(Radio1.SelectedText.Value = "All", !IsBlank(PlainText(Status)), PlainText(Status) = Radio1.SelectedText.Value)
)

This data source works as desired in on the screen that displays the gallery.  However, on my "details" screen, where I have the Display control, I get the error that others have experienced.  When I comment out the datasource above and replace a simple reference to the underlying data source, the display control works fine.

But that's still a bug against the expected behavior of data source operations. It looks to me that PowerApps is becoming worse day by day.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (6,968)