Autonumbering working in QGIS, not in MM mobile app
Hi, I’ve set up autonumbering for a field that numbers trees, grouped by values in another field (Site Name) - trees on different sites can have the same number, but on any one site they should all have different numbers. I want any new tree point I create to automatically have the next unused number for that site.
I’ve done this by in the Attributes Form setting the default for Tree No to the expression coalesce(maximum("Tree No", group_by:="Site Name"),0) + 1. I have unticked Apply default value on update.
This works perfectly when I add points in QGIS, but in the Mergin mobile app it adds an extra one so the number is 2 higher than the last used number, rather than only 1 higher.
Any ideas why this is happening and how I can fix it? (maybe the form is updating twice in the mobile app for some reason, but not in QGIS?)
Any thoughts/help would be much appreciated.