Set(
varNewUniqueID,
If(
IsBlank(First('SLO - Affiliated Club Addresses')),
1, // Use 1 if there are no records in the list
First(Sort('SLO - Affiliated Club Addresses',UniqueID,SortOrder.Descending)).UniqueID + 1
)
);
If(
UpdateClubForm.Mode = FormMode.New,
Patch(
'SLO - Affiliated Club Addresses',
Defaults('SLO - Affiliated Club Addresses'),
{
Title: DataCardValue44.Text,
Activity: ComboActivity.Selected.Title,
Multi_Use_Facility: DataCardValue54.Selected,
'Street Address': DataCardValue47.Text,
Suburb: ComboSuburb.Selected.Title,
Postcode: ComboPostcode.Selected.Title,
LGA: DataCardValue50.Text,
State: DataCardValue51.Text,
UniqueID: varNewUniqueID
}
),
SubmitForm(UpdateClubForm);
);
ViewForm(UpdateClubForm);
This will get the correct new unique id for the new record.
I hope this information is helpful!
If my post resolved your issue, please click "Accept as Solution" so others can easily find it too. This will also mark the item as closed. If you found the content useful in other ways, a "Thumbs Up" would be greatly appreciated.