I have in my Record Types two fields, Created By and Modified By. Both of those data types are set to user.
They are also linked to the Appian User.
I have a Process Model kicked off by a Portal. I would like to get the initiator of the process to be saved into one of these two fields. I have used:
In all of these cases, I got the process error (Could not cast from User to User. Details: CastInvalid) (Data Outputs)!!! This works in all other areas of the application, just not in the process model kicked off by the Portal.
Discussion posts and replies are publicly visible
Not sure why you want to store the initiator? It will always be that service account.
That service account is a different type of user and it could be that when that process is initiated by that same account, that user does not have permission to do that cast. This is mostly guessing on my side though.
The process I am using can be kicked off by the Portal as well as by the office personnel from the speaker interface. I thought I would capture both. The service account has explicit security access to the process model and is in the administration group for the application.
You are probably right. I have the same logic other places in the process and it works if I initiate the process with my ID (i.e. from the administration interface).
So to get around the service account and still get the user from the administration screen, I used the following logic to load the pv!processUser.
if( cast(typeof("abc"), pp!initiator)="PMSO_ServiceAccount", null, pp!initiator )
That's a good solution. Instead of that cast and typeof construct, you can just do a tostring().
Thanks again!!!