Hi @cv2qm ,
Do you want to add or update two records in your SQL Table via press the "Submit" button once time?
Regarding the needs that you mentioned, I agree with @Pstork1 's thought almost. If you want to update records in your SQL Table, you need to use a Unique Type column as a Primary Key, e.g. a Auto-Increment type column (identify(1,1)).
Actually, it is not necessary to add four individual Text Input box controls in your canvas app to collect data entry, instead, I think the Gallery control could achieve your needs.
You could consider add a Gallery control in your app, then add two Text Input Box inside it. The configuration may look like below:


Set the OnStart property of App to following:
ClearCollect(Table1, {Id:1, PRIMARY_NAME: "", AWARD: "", OFFER_AMOUNT: ""});Clear(Table1);
ClearCollect(NewEntry, Defaults(Table1), Defaults(Table1))
On your side, you should type:
ClearCollect(NewEntry, Defaults('Table Name'), Defaults('Table Name'))
Add a Gallery, set the Items property to following:
If(
ComboBox1.Selected.Value in Table1.PRIMARY_NAME,
Filter(Table1, PRIMARY_NAME = ComboBox1.Selected.Value),
NewEntry
)
On your side, you should type:
If(
ComboBox1.Selected.PRIMARY_NAME in 'Table Name'.PRIMARY_NAME,
Filter(Table1, PRIMARY_NAME = ComboBox1.Selected.PRIMARY_NAME),
NewEntry
)
Within the Gallery, add two Text Input boxes, one for AWARD, another one for OFFER_AMOUNT. Set the Default property of AWARD TextInput box (TextInput1) to following:
ThisItem.AWARD
set the Default property of the OFFER_AMOUNT TextInput box (TextInput2) to following:
ThisItem.OFFER_AMOUNT
Set the OnSelect property of the "Submit" button to following:
If(
ComboBox1.Selected.Value in Table1.PRIMARY_NAME,
ForAll(
RenameColumns(Filter(Gallery1.AllItems, !IsBlank(TextInput1.Text) && !IsBlank(TextInput2.Text)), "Id", "Id1"),
Patch(
Table1,
LookUp(Table1, PRIMARY_NAME = ComboBox1.Selected.Value && Id = Id1),
{
AWARD: TextInput1.Text,
OFFER_AMOUNT:TextInput2.Text
}
)
),
ForAll(
Filter(Gallery1.AllItems, !IsBlank(TextInput1.Text) && !IsBlank(TextInput2.Text)),
Patch(
Table1,
Defaults(Table1),
{
Id: CountRows(Table1) + 1,
PRIMARY_NAME: ComboBox1.Selected.Value,
AWARD: TextInput1.Text,
OFFER_AMOUNT:TextInput2.Text
}
)
)
)
On your side, you may need to type the following formula:
If(
ComboBox1.Selected.PRIMARY_NAME in 'Table Name'.PRIMARY_NAME,
ForAll(
RenameColumns(Filter(Gallery1.AllItems, !IsBlank(TextInput1.Text) && !IsBlank(TextInput2.Text)), "Id", "Id1"),
Patch(
'Table Name',
LookUp('Table Name', PRIMARY_NAME = ComboBox1.Selected.PRIMARY_NAME && Id = Id1),
{
AWARD: TextInput1.Text,
OFFER_AMOUNT:TextInput2.Text
}
)
),
ForAll(
Filter(Gallery1.AllItems, !IsBlank(TextInput1.Text) && !IsBlank(TextInput2.Text)),
Patch(
'Table Name',
Defaults('Table Name'),
{
PRIMARY_NAME: ComboBox1.Selected.PRIMARY_NAME,
AWARD: TextInput1.Text,
OFFER_AMOUNT:TextInput2.Text
}
)
)
)
Please try above solution, then check if the issue is solved.
I have also attached my sample app below, please refer to it, then check if it could help in your scenario.
Regards,