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 / Strange behavior code ...
Power Apps
Answered

Strange behavior code working in Edit mode, but not in Teams

(0) ShareShare
ReportReport
Posted on by 139

Hello,

 

I have a PowerApps App where the code is working within the Edit mode but not within Microsoft Teams. 

 

This is how it should like(Edit mode):

Belasor_0-1596707784904.png

 

This is how it looks with the App integration in Microsoft Teams:

Belasor_1-1596707878000.png

 

 

If(ThisItem.Capacity <= CountRows(Filter(SeatingRequests;DateText = Text(_dateSelected; DateTimeFormat.ShortDate) And 'Room Number'=ThisItem.'Room Number' And !(Approvalstatus = "04 - Rejected"))); "This room is already booked"; "Available seats: " & ThisItem.Capacity - CountRows(Filter(SeatingRequests;DateText = Text(_dateSelected; DateTimeFormat.ShortDate) And 'Room Number'=ThisItem.'Room Number' And !(Approvalstatus = "04 - Rejected"))) & "/" & ThisItem.Capacity)

 

The available seats are unfortunately wrong and I don´t know why. All users have the problem within teams. When I set the user as Co-owner and they edit the app it is working.

 

Categories:
  • GarethPrisk Profile Picture
    2,828 on at

    That appears to only show the Gallery, and not the controls it's referencing as well. Can you show an entire like-for-like screenshot with identical inputs?

     

    What is the data source of the Gallery? Is there any reason that Teams wouldn't have access to the same data? Is it a collection or directly referring to the data source by name?

  • Belasor Profile Picture
    139 on at

    Hi GarethPrisk,

     

    The data source is SharePoint. There is no reason why it shouldn´t work to be honest, it was working before. Access is also set for everyone.

     

    What do you mean by entire like-for-like screenshot.

    This is the entire screen(Edit mode).  The user is picking the date and then you should see the correct values. It is ignoring just the complete code above, in my first post. It´s just ignoring the code in the gallery.

    Belasor_0-1596714278278.png

    Buttoncode:

     

    If(ThisItem.Capacity <= CountRows(Filter(SeatingRequests;DateText = Text(_dateSelected; DateTimeFormat.ShortDate) And 'Room Number'=ThisItem.'Room Number' And !(Approvalstatus = "04 - Rejected")));RGBA(127; 127; 127; 1);RGBA(30; 60; 90; 1))

     

    Available seats code:

    If(ThisItem.Capacity <= CountRows(Filter(SeatingRequests;DateText = Text(_dateSelected; DateTimeFormat.ShortDate) And 'Room Number'=ThisItem.'Room Number' And !(Approvalstatus = "04 - Rejected"))); "This room is already booked"; "Available seats: " & ThisItem.Capacity - CountRows(Filter(SeatingRequests;DateText = Text(_dateSelected; DateTimeFormat.ShortDate) And 'Room Number'=ThisItem.'Room Number' And !(Approvalstatus = "04 - Rejected"))) & "/" & ThisItem.Capacity)

     

  • GarethPrisk Profile Picture
    2,828 on at

    Are those warnings for delegation?

     

    If so, keep in mind it will only retrieve as many rows as is setup in the app settings. If you're not dictating an order on the filter, you may getting different delegated data sets for each app run.

     

    You may want to establish an onChange function on the date picker which recollects the data you need, so you can ensure it is accurate. Otherwise, you can revise your formulas to try to avoid delegation.

  • Belasor Profile Picture
    139 on at

    Yes, this are warnings for delegations.

    Belasor_0-1596718946479.png

    The limit is at 2000, the list size is around 120 entrys. So that should be fine.

    I don´t get the other solutions, normally it should be fine?

  • Belasor Profile Picture
    139 on at

    Still need help 🙂

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Belasor ,

     

    You need to debug your issue step by steps.

    The issue can actually be located directly in the CountRows formula or the output of Filter formula. For further debugging, Try to use the labels to show each argument in the Filter formula and a nested gallery to show filtered tables. In addition, add a label out of gallery to count rows of SeatingRequests to check debug the CountRows function and Data source access permission.

    Compare the differences between the parts in the two cases to determine the issue.

    Hope this helps.

    Sik

     

  • Verified answer
    Belasor Profile Picture
    139 on at

    Thank you both for the help, I could resolve the issue last week. The problem was that the CountRows function wasn´t working.

     

    CountRows(Filter(SeatingRequests;DateText = Text(_dateSelected; DateTimeFormat.ShortDate)

    changing both to date fields solved that problem.

     

    BR 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard