Hey guys,
I am trying to make an editable grid using a gallery, i am facing an issue where whenever i keep on save it doesnt override the previous records instead it adds to them in my data verse table.
so for my gallery this is the item for it:
If(
IsBlank(
LookUp(
colGridUpdates,
'PO Supplies Detail' = ThisItem.'PO Supplies Detail'
)
),
Collect(
colGridUpdates,
ThisItem
)
);
UpdateIf(
colGridUpdates,
'PO Supplies Detail' = ThisItem.'PO Supplies Detail',
{
'Expenditure Type': ExpenditureTypeInp.Text,
'Deliverables ': DeliverablesInp.Text,
'PO Id': NewPOID,
'Date Promised ': DatePromisedInp.SelectedDate,
Amount: Value(AmountInp.Text),
'New Quantity ': Value(newQuantityInp.Text),
'Previous Quantity ': Value(prevQuantityInp.Text),
'New Unit Price': Value(newUnitPriceInp.Text),
'Previous Unit Price': Value(preUnitPriceInp.Text),
UOM: UOMInp.Selected.Value,
WBS: WBSInp.Text
}
);
the 'PO Supplies Detail', is the uniquely identifier from my table and then is my save functionality:
Patch(
'PO Supplies Details',
ShowColumns(
colGridUpdates,
'IR Request ID',
'PO Id',
'New Quantity ',
'Date Promised ',
'New Unit Price',
'Expenditure Type',
'Deliverables ',
'Previous Quantity ',
'Previous Unit Price',
Amount,
UOM
)
);
Clear(colGridUpdates);
if anyone can help me with this i would really appreciate it and thank you.
@nunuNMS - nothing obvious to me. I would suggest removing one field from your code, and then run the Patch again. If duplicates continue to appear, remove another field and then run the Patch again. Keep doing this until you can pinpoint which field is causing the problem.
Hey there,
No the UOMInp isnt a combo box its a dropdown menu, do you have any ideas on what could be causing this issue? thank you so much
@nunuNMS - from a Dataverse perspective your code looks fine to me.
Is UOMInp a ComboBox? There is a long standing bug which causes the OnChange property to trigger whenever the Gallery is refreshed, thus the duplicates. If possible, remove the ComboBox and replace with a Dropdown control.
WarrenBelz
146,653
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional