Skip to main content

Notifications

Community site session details
Power Apps - Building Power Apps
Answered

Invalid Formula. Expected a value compatible with 'DataSource'

Like (6) ShareShare
ReportReport
Posted on 10 Jun 2020 07:54:38 by

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?

Categories:
  • Carlos_Oliv Profile Picture
    4 on 01 Jun 2024 at 13:36:43
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    Hi,

    Duplicating the screen solved the problem for me!

     

    Thanks @bigfella 

  • CU03032103-0 Profile Picture
    37 on 29 Dec 2023 at 19:06:50
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    Try duplicating the screen and see if that fixes it. 

     

    I had the same issue. In my case the gallery and form had the same sharepoint list as the datasource, though I was using a filter function on the gallery. I tried readding the datasource to each, but had no luck. Duplicating the screen however cleared it right up. 

  • SCTdan Profile Picture
    604 on 01 Jun 2023 at 15:06:29
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    This just happened to me.  SharePoint datasource, basic.  Weird thing is, it was working just fine, then I closed out of my browser session, and when I reloaded it today I started getting this error.  No changes.  I can go create a new app and it'll work exactly the same way I've got it set, but no matter what I do I can't get it working again in the original app, even deleting and recreating the connection and form etc.

    Weird error, never seen it before.

  • ccondran08 Profile Picture
    12 on 11 May 2023 at 07:17:06
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    Click on both the EditForm and then then  DetailForm which should be the boundary of the screen then go to the Advanced edit tab on the right and then look for the  Item field which should be under the "Data" heading. This item should say something like "BrowseGallery1.Selected". Check that this name matches your Browse Gallery name under the Summary screen. Double click on this and change to the correct Browse Gallery name then this error will go away.

  • ccondran08 Profile Picture
    12 on 11 May 2023 at 07:14:32
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    Click on both the EditForm and then then  DetailForm which should be the boundary of the screen then go to the Advanced edit tab on the right and then look for the  Item field which should be under the "Data" heading. This item should say something like "BrowseGallery1.Selected". Check that this name matches your Browse Gallery name under the Summary screen. Double click on this and change to the correct Browse Gallery name then this error will go away.

  • Fuzzy1 Profile Picture
    171 on 19 Apr 2023 at 14:51:54
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    I had to make a minor change for this to work for me.  

     

    Set OnSelect of Gallery1:
    Navigate(Edit_Screen,ScreenTransition.Cover); Set(SelectedItemId, ThisItem.Id)

     

    Set Form1.Item property:
    LookUp(Holiday_List,Id=SelectedItemId)

  • Fuzzy1 Profile Picture
    171 on 19 Apr 2023 at 14:50:24
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    I had to make minor changes for this to work for me. 

     

    Set OnSelect of Gallery1:
    Navigate(Edit_Screen,ScreenTransition.Cover); Set(SelectedItemId, ThisItem.Id)

     

    Set Form1.Item property:
    LookUp(Holiday_List,Id=SelectedItemId)

  • jvdduke Profile Picture
    3 on 14 Dec 2022 at 16:24:32
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    This also happens when the Browse Gallery is a flexible height gallery. Even with the Data Source is a straight Sharepoint Table (no Filtering or Sorting). Microsoft please fix. The workaround works. FYI the variable in the workaround is not necessary. Can just use ID=BrowseGallery1.Selected.ID

  • mrdickiePA Profile Picture
    11 on 06 Sep 2022 at 16:32:51
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    Yes I can concur with Muli but I am still unable to find the answer. The workaround did work for me (once i got the right syntax and spelling right! Actually I was too quick to answer there. I do get some data pop up when I click on the item in browser gallery but details screen only picks up the first line in my datasource so its like its not filtering or something. I'm using a search function to narrow down my items incidentally

  • krishangopi Profile Picture
    33 on 17 Jun 2022 at 06:24:18
    Re: Invalid Formula. Expected a value compatible with 'DataSource'

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started