Hello,
I'm having some trouble with my app. My app, if a record field matches the column 'Helper', takes the user to an 'Update' screen. The goal with the Update screen is to update a record if a match between the Helper column in Table1 and the Helper column in the collection is found. If not, it patches a new record to the data source/table (I'm using Excel).
The problem: I'm trying to use UpdateIf to change the collection 'Revised' field to 'yes' if there's a match. However, when I use UpdateIf, it's updating ALL records in the collection Revised column to 'yes', (or in this case 'lasttest') not just the updated record. It shows up as:
Is it possible to have it so only the revised records show as 'yes' and the new records be blank/left alone?
Any help is greatly appreciated.
Below is the code:
ForAll(
collection1,
If(
IsBlank(LookUp(Table1, Helper = collection[@Helper])),
Patch(Table1, Defaults(Table1), {'BOL No': collection1[@'BOL No'],
'Arrival Time': collectionname[@'Arrival Time'],
'Branch No': collectionname[@'Branch No'],
'Date Received': collectionname[@'Date Received'],
'Delivery Quality': collectionname[@'Delivery Quality'],
'Departure Time': collectionname[@'Departure Time'],
'Point of Contact': collectionname[@'Point of Contact'],
'Notification of Late Delivery via': collectionname[@'Notification of Late Delivery via'],
'Master Load ': collectionname[@'Master Load '],
'Issue Code': collectionname[@'Issue Code'],
'Item ID Ordered': collectionname[@'Item ID Ordered'],
'Item ID Shipped': collectionname[@'Item ID Shipped'],
'Qty Ordered': collectionname[@'Qty Ordered'],
'Qty Received': collectionname[@'Qty Received'],
'Qty Shipped': collectionname[@'Qty Shipped'],
'Damage Description': collectionname[@'Damage Description'],
Helper: collectionname[@Helper],
'Service Failure': collectionname[@'Service Failure'],
'Customer Failure': collectionname[@'Customer Failure'],
XFRNo: collectionname[@XFRNo],
Comments: collectionname[@Comments],
Revised: ""
}),
Patch(Table1, LookUp(Table1, Helper = collectionname[@Helper]), ThisRecord, {Revised: "Yes"})
)
)
; UpdateIf(Table1, Helper in collectionname[@Helper], {Revised: "Yes"});