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

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,625)