cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Belasor
Helper III
Helper III

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

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions

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 

View solution in original post

7 REPLIES 7
GarethPrisk
Resident Rockstar
Resident Rockstar

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?

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)

 

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.

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
Helper III
Helper III

Still need help 🙂

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

 

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 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,886)