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 / Trouble again with pat...
Power Apps
Answered

Trouble again with patch and lookup

(0) ShareShare
ReportReport
Posted on by 421

Hi everyone.  I am trying to update a DV table from inside a gallery where the datasource of the gallery is different from the DV table I am trying to update.  I have used a lookup and patch in a similar situation but cannot figure this one out.

The datasource of the gallery is Depot-Lineitems, and I am trying to patch to the column crd63_qtyonhand in DV table Depot-Parts.

 

The error I am getting is below as well as the code from the patch.  Thanks all for the help!  

ckserra33_0-1684425586479.png

 

 

Patch(
'Depot-Partss',
LookUp(
'Depot-LineItems',
crd63_barcodenumber = ThisItem.crd63_barcodenumber
),
{crd63_qtyonhand:5}
)

Categories:
I have the same question (0)
  • Verified answer
    HenWang Profile Picture
    Microsoft Employee on at

    Hi @ckserra33 ,

     

    For this question, I need to know where this patch button exist, is it inside the gallery or outside the gallery?

     

    Suppose it exist inside the gallery, then you have to use this formula instead:

    Patch(
    'Depot-Partss',
    LookUp(
    'Depot-Partss',
    crd63_barcodenumber = ThisItem.fieldName_in_Depot-LineItems
    ),
    {crd63_qtyonhand:5}
    )

     

    Only in this way can you update the row whose crd63_barcodenumber value equals to thisitem.fieldName in your Depot-LineItems list.

     

    Best Regards,

    Hen Wang

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    The Datasource of LookUp and Patch should be the same..
    Mark as solution if this helps

  • ckserra33 Profile Picture
    421 on at

    Hi @HenWang , thank you very much for your help, that worked perfectly!

  • ckserra33 Profile Picture
    421 on at

    Hi @ShaheerAhmad  , thank you very much for your help, that worked perfectly!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard