Given a string containing a username (this can change easily to user first + last name),
I would like to assign a task.
I am using the following expression to get the user
=touser("Yoel.Feuermann-yoel.feuermann@zencargo.com", "-")[1])
if I try the above in a FORM - it works.
but If I have it in the assignment expression - it doesn't assign properly
it gets assigned, but to an empty user:
Discussion posts and replies are publicly visible
Can you post a screenshot of what the current value of pv!selected_agent is in your process instance where you tried this?
sure
I know it's a bit small. it says: yoel.feuermann@zencargo.com-yoel.feuermann@zencargo.com
since the email is my username
I'm unclear why you are using a dash-separated string instead of an array, but I assume you have your reasons. I'm unclear what exactly isn't working for you; one pitfall I'd like to note, in case you've missed it, is that any time you edit the "assignment" box via the "Edit Expression" button, the edited expression is appended to previous entries in that box for some reason, instead of replacing the previous expression. I often recommend completely clearing out the assignment picker box then pasting in an expression fresh, though you can also click into the box and use the Left / Right arrow-keys to navigate around and ensure there's only one expression entry.
this edit the assignment box behaior is a complete pain in the ass and I face this every now and then.Is there any chance that appian will gonna change/fix this one day?
Yes, it is for internal reason, usually user has a username that is not the email, and we need the email part to send emails to their address
Good question - my thinking is that it was originally designed to function primarily as a "person / group picker" and that the addition of expressionable behavior was secondary, and I have to think the behavior I named above is a bug rather than intentional (but who knows).
Gotcha - though as a word of advice / caution, if there's any chance you can still change the way your data is structured, I'd strongly suggest you put those data points (username, email, etc) in a per-user CDT rather than stuffing everything into a flat text value. I would expect doing it your current way might pretty quickly become unmanageable.
BTW, were you able to verify whether the "assignment box" issue I described above is happening?
Thanks, but still not working. Getting the following:
It's assigned, but with no owner:
and if I check the process details for running tasks, i get none:
Yoel F said:It's assigned, but with no owner:
You would need to click on the task instance, then click "View Node Details", then view the "Assignment" tab to show the unaccepted assignee. This is standard behavior. The "Owner" column won't populate until a user has opened/accepted the task, even if the assignment is to a single user.