cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

Patch not working correctly in FORALL and with a lookup column

I created a quick PowerApps to copy records from one SharePoint list to a similar, new one.  Made some tweaks in the new list, and one of those was to make a column a lookup ; the source table for the copy has the column as a single line of text.

 

When the app runs, all the records copy over, but just two of them have a value in the new lookup column and neither of those values correspond to the value of the text columnin the source.  The remainder are just blank.

 

The app is very simple:  I created two galleries, one with items = 'source table' and the other with items = 'target table' and a button that contains the following expressions:

 

ForAll('source',
Patch('target',Defaults('target'),
   {Title:Title,
    Quantity:Value(jc_ItemQuantity),
    OrderedBy:Ordered_x0020_By,
    DateOrdered:Date_x0020_Ordered,
    OrderComments:Comments,
     Store: {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id:'Items  Ordered'[@ID], Value:Store},
    Status:OrderStatus,
    DateShipped:Date_x0020_Shipped,
    ShippingComments:jc_Comments,
    DateReceived:Date_x0020_Received,
    DateOnHold:Date_x0020_on_x0020_Hold,
    OnHoldComments:jc_Comments,
    DateCanceled:Date_x0020_Canceled,
    OnHoldReason:On_x0020_Hold_x0020_Reason}))

 

The red part is what is not working properly.  Since all of the other fields do copy properly, I have assumed that the FORALL causes the data to advance in the source list and that by grabbing those values in the PACTH it would work.  So, Store as a text field in the source should copy over as the "lookup" result in the target, right?

 

I have tried at least a dozen expressions and this is the only one that did not give me a PATCH error on the button.

 

Thanks in advance for your help.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,421)