I have a user picker that selects max 3 users. In the process model I want to send the email to all the users in the array of users.
Discussion posts and replies are publicly visible
Hi,
As Mike mentioned it is straight forward implementation. In your process add a process variable of type user (It should be Array type). Then save your selected picker field values/users to this process variable. In your email node call this process variable in TO field using expression editor.
Tried this method however script task isn't saving reviewer to selected users
if possible con you share your code and screenshots of process configuration. It is difficult to answer whit out knowing what you have done
oludareo0002 said:Tried this method however script task isn't saving reviewer to selected users
well, that means your problem isn't in the send email node, for one thing. As Naresh already said, please share the expression code where you're attempting to set the value of pv!selectedUsers so we can help troubleshoot. To confirm, are you saying that PV is ending up blank? Or some other issue? Can you confirm what type it is? As in, is it "User" type with "multiple" selected?
Type is user script task before the email to store reviewer variable into created process variable
Did you verify the pv!reportRequest.reviewer have any value? you will be able to find this value from your existing instance process details or process properties.
What's the CDT type definiton for the "reviewer" field here? I can't tell from the screenshot whether it's anything more than plaintext.
Thus I'm worried that when you're trying to save the value of this field into your "selectedUsers" PV array, it's failing to save any value because it's trying to find a user with a username of, literally, "oludare.olugbemi sylvester.ezeani; fakeuser", and of course there is no user with that full string as its username.
Reviewer is a text field
That's what i thought - so in order to make your script task work, you'll need to parse through the text representing a list of usernames (i assume the text field is not an array).
In your script task try putting this instead of "pv!reportRequest.reviewer":
trim(split(pv!reportRequest.reviewer, ";"))
Worked! Thank you!