I see, understood! I already try this formula but it is not working on me.
I am having difficulties in creating an auto increment which starts with prefix.
In the picture below, I wanted to make if the user choose the radio button such as Electronic, the part number will increase 1, which is it will be "E-000005".

I want to make it increment 1 based on the latest part number according to their Stock Type in database (as picture)

This is my code for:
1. OnChange radio button:
UpdateContext({varSelectedStockType: Radio2.Selected.Value});
UpdateContext({varPartNumber: LookUp(Sort(Filter(Samples,'Stock Type'= varSelectedStockType),'Part Number',SortOrder.Descending),true,'Part Number')});
2. Default text input:
Concatenate(Left(varSelectedStockType,1),"-",Text(Value(Right(varPartNumber,Len(varPartNumber)-2))+varCounter,"000000"))
3. On Select Save button:
SubmitForm(Form3);ResetForm(Form3);
Set(varCounter, varCounter + 1)
May I know is there any different?