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 / Delegation Help with I...
Power Apps
Unanswered

Delegation Help with Indexing

(0) ShareShare
ReportReport
Posted on by 194

Hi All,

So i'm pretty familiar with the delegation warning in power apps as I had to learn how to fix some of my patch filtering, but this one is completely at a loss for me and I'm hoping someone out there can help me.

 

I have a scan barcode function that a user can scan tag number and serial number in that order on an item before moving onto the next. The code looks like this to patch:

ForAll(Sequence(CountRows(tags) / 2), 
If(IsEmpty(Filter(Inv_Equipment, AssetTag = Index(tags, Value * 2 - 1).Value)),
Patch(Inv_Equipment, Defaults(Inv_Equipment), {
 AssetTag: Trim(Index(tags, Value * 2 - 1).Value), 
 SerialNumber: Trim(Index(tags, Value * 2).Value), 
 }, ReceiveForm_1.Updates)))

 

The line of code where it says AssetTag = Index(tags, Value * 2 - 1).Value)) has a delegation warning and it is causing issues now that our data is more than 2k records (it's actually 34k records after migrating). 

 

The spec needed is the first scanned number is the tag, second is the serial and I need to save it in the respective column, the issue is the filtering before patching, I don't want duplicate records in my database so I need to check that the first tag (asset tag) does not exist. Anyone know how to resolve this delegation warning while keeping the spec? Thank you so much!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,052 Most Valuable Professional on at

    Hi @Nicci ,

    I may not have the logic totally correct, but you should get the idea here to take the calculation out of the Filter.

    ForAll(
     Sequence(CountRows(tags) / 2), 
     With(
     {
     _Tag: Index(tags, Value * 2 - 1).Value
     _Serial: Trim(Index(tags, Value * 2).Value)
     },
     If(
     IsEmpty(
     Filter(
     Inv_Equipment, 
     AssetTag = _Tag
     )
     ),
     Patch(
     Inv_Equipment, 
     Defaults(Inv_Equipment), 
     {
     AssetTag: Trim(_Tag), 
     SerialNumber: _Serial
     }, 
     ReceiveForm_1.Updates
     )
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 490

#2
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 381

Last 30 days Overall leaderboard