I would like some advice please. I want to store the app user's name/info in the feature service table when a feature is added. This is simply so that I can identify who added the feature to the table. How can this be done? I have tried adding information using Secure Storage and then retrieving the info to be stored as the attribute but that did not work.
Thank you in advance.
First of all, this functionality can be easily done by enabling editor tracking in the feature layer.
But if you prefer to do this manually, you can just include the user information in the appropriate fields in your feature layer, just like when you are adding other information to the feature layer.
What exactly did not work in your attempt? What's the error message?
Hi, thank you for the reply. I was not aware of the editor tracking I will take a look at that. Can you further explain the manual method? Thank you.
there's no error message, what I did was include this piece of code
retrieveData.text = qsTr("Value: ") + SecureStorage.value(key.text)
in this part of the Add Features Code:
// create attributes json for the new feature
The "manual method" is just simply adding another field(s) to your feature layer, then when you do addFeature or applyEdit, make sure to include that new information to the new field(s).
I think you meant to show more code in your previous comment?
I enabled the editor tracker as well and I was able to see who is making an edit (in this case it was me) however majority of the app users will be the general public with no ArcGIS Online account. Would I still be able to see who added a feature?