This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Get pseudo-user id from Workflow state

Former Member
Former Member
Hi,

I have been looking into how to get a pseudo-user ID from the workflow state.
For example The user who moved the object into the state "State name"

I have been trying to get it to work using the method UserOrUserGroupIDEx unsuccessfully.
https://www.m-files.com/api/documentation/latest/index.html#MFilesAPI~UserOrUserGroupIDEx.html

I have the notification email ready to send, I just need to get the user. Any suggestions?

Thanks,
Conny
  • Can you show what you've tried?

    Typically you would simply find the version that equates to the end-result of that workflow state transition (i.e. if the transition is A->B, you would find the version in the history of B), then simply read the ID of the user who last modified that version.

    Regards,

    Craig.
  • Former Member
    Former Member
    Thanks, Craig

    I had the wrong thinking, I was trying to retrieve the user ID from passing the workflow state into the UserOrUserGroupIDEx SetWorkflowStatePseudoUser method. I then wrongly thought that it would return the right user ID. I will get the user id now from the objects Vault.ObjectOperations.GetLatestObjVer.

    One question though, if I would like to retrieve the user ID for The user who moved the object into the state "State name"
    Suppose the state is State 1 (See below), and the object is now two states ahead. Is there some convenient way to retrieve the user from State 1?

    |no state| --> |State 1 (User 1)| --> |State 2 (User 1)| --> |State3 (user 2)|

    Would the best approach be the get the earlier object versions?
  • Unfortunately, in this case, you would need to load the object history and iterate through it to find the one you need. It isn't ideal, but that's the only way that I'm aware of.

    Regards,

    Craig.