Hi – I’m trying to save the user ID who entered data on a page so that it is an audit trail of sorts. I’ve seen posts on how to show the CurrentUser on a page, but in this case I need to save the user ID who entered a particular note on a page. How can I go about doing this? I tried starting a microflow to retrieve CurrentUser but didn’t get far. Sorry if this question is a simple one; I really did try to search the forums and online for this! Ultimately I think I have to save the “entered by” user ID on my entity but need a microflow to get me there.
If you are looking to create an audit trail, there is the Audit Trail module in the App Store that may be of use.
If you are just creating a note entity, then you could check the Store ‘owner’ option in the domain model. When it’s created it should store who created the entity automatically, and you could just retrieve this as needed.
To add on to Roberts answer, if you set up your entity to capture Owner and ChangedBy, as shown below, Mendix will store the Owner (the user who created the object) and the user who last changed a given object. Note that Owner will never change, but ChangedBy only contains the user who change the object last.