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 bevavior (anom...
Power Apps
Unanswered

Strange bevavior (anomaly) with Gallery

(0) ShareShare
ReportReport
Posted on by 51

I develop an app for processing incoming invoices. You can tag the invoices with supplier, invoice number, amount etc. Also, you can add (I call it) invoice items to divide the amount into different cost centers and projects.

To see the problem, please see the attached gif.

There I select an invoice, add two (!) invoice items and fill out other required properties. Then I save it (assign to professional approval). Then I select the next invoice, and add three (!) invoice items. After saving and selecting the next invoice, the last invoice item is added initially. This happens only when I had more than 2 invoice items before. Why at all and why only from 2 items on?

 

In "OnVisible" of the Screen, where I can fill out the form, I have following code:

Clear(InvoiceItems);

// "invoice" is the selected invoice that is passed by the screen transition
Collect(InvoiceItems, Filter('Invoice Items Sharepoint List', Invoice.Value=Text(invoice.ID)));

UpdateContext({ invoiceItemTempId: With({ i: Max(InvoiceItems, ID) }, If(IsBlank(i), 1, i + 1)) });

// if there is no invoice item than create a new one, such that there is at least one by default
If(CountRows(InvoiceItems)=0, Collect(InvoiceItems, Patch(Defaults('Invoice Items Sharepoint List'), { ID: invoiceItemTempId, Invoice: { Id: invoice.ID, Value: Text(invoice.ID) } })));

UpdateContext({ startInvoiceItemTempId: invoiceItemTempId, invoiceItemTempId: invoiceItemTempId + 1 });

 

The "Items" property of the gallery is set to "InvoiceItems".

 

Does anyone have an idea why this anomaly happens, and then only with at least 3 invoice items?

Power App Probleme Verpixelt.gif
Categories:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard