I am developing an app in Teams power app
I am trying to use the below code on the default value of edit form field by this code,
(First(Sort(TblSvcHistories, LineNo, SortOrder.Descending)).LineNo)+1
this I applied to bring the Last Value +1 for my counting's requirement
It works fine and bring the correct result, But keep value applied all the time. even in the other records. Till it is closed.
BUT I want to value to be brought only if the form is in NEW mode. I mean while entering the new record
tried by FormName.FormMode check, but not work.
Please guide a correct way to approach the same formula for the requirment

