
Announcements
I have this code but only updates a row if a row does not work, so I used if statement and lookup if exist it will patch if not collect. But seems it's not working.
If(LookUp('ItemList', Title = ID.Text),
Patch(ItemList, LookUp('ItemList', Title = ID.Text), {
Title: ID.Text,
ENM: ENM.Text,
CNM: CNM.Text,
}),
Collect(ItemList, {
Title: ID.Text,
ENM: ENM.Text,
CNM: CNM.Text,}))
Is this okay to use or is there another way of doing this? Thanks
@nagestiada
You are simply missing the logical comparison in the 1st argument of your IF statement.
If(
!IsBlank(LookUp('ItemList', Title = ID.Text)),
Patch(ItemList, LookUp('ItemList', Title = ID.Text), {
Title: ID.Text,
ENM: ENM.Text,
CNM: CNM.Text,
}),
Collect(ItemList, {
Title: ID.Text,
ENM: ENM.Text,
CNM: CNM.Text,
})
)