Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / Expected a value compa...
Building Power Apps
Unanswered

Expected a value compatible with datasource

Posted on by 171
Hello,
 
I'm in need of some help and i cant understand what's causing the issue. I have a screen (lets call it Screen1) which has a Gallery with the following code in the Items property:
 
With(
    {
        Items:Filter(Visits, 'User_ID:Email'.Value = User().Email)
    },
    ForAll(
        Sequence(CountRows(Items)),
        Patch(
            Last(
                FirstN(Items,Value)),
                {rowNumber: Value}
            )
        )
)
For each record on the Gallery theres a button, when that button is click its takes you to Screen2 with an edit form to complete. The OnSelect property of that button is the below:
 
Set(varSelectedAssignment, ThisItem);
Navigate(Screen2,ScreenTransition.Fade)
 
On the form in Screen2 i have the DataSource property set to "Visits" and the Item property set to "varSelectedAssignment.ID". 
 
The error I'm getting is "Invalid formula. Expected a value compatible with 'DataSource'".
 
I've also tried setting the Item property to just "varSelectedAssignment" and i get the same error. 
 
Any help on solving this issue would be much appreciated. Thank you in advance.
  • timl Profile Picture
    timl 31,547 on at
    Expected a value compatible with datasource
    Hi CCEP_Mike,
     
    The formula for the gallery adds rowNumber to ThisItem so it no longer matches the schema of Visits.
     
    If you change the Item property of the form on Screen2 to the following, that should hopefully resolve the problem.
     
    LookUp(Visits, ID=varSelectedAssignment.ID)
     

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,122

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,414

Leaderboard