<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Send email to array of users</title><link>https://community.appian.com/discussions/f/process/24477/send-email-to-array-of-users</link><description>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.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94753?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 17:59:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bdda0bc4-a92c-41df-81c1-9e49aec9cbcd</guid><dc:creator>oludareo0002</dc:creator><description>&lt;p&gt;Worked! Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94746?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 16:28:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a73b599-0c8f-405d-a47b-5cb22dde34ec</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;That&amp;#39;s what i thought - so in order to make your script task work, you&amp;#39;ll need to parse through the text representing a list of usernames (i assume the text field is not an array).&lt;/p&gt;
&lt;p&gt;In your script task try putting this instead of &amp;quot;pv!reportRequest.reviewer&amp;quot;:&lt;/p&gt;
&lt;p&gt;trim(split(pv!reportRequest.reviewer, &amp;quot;;&amp;quot;))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94744?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 16:26:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b21c287-d121-412a-8e85-53de19efa263</guid><dc:creator>oludareo0002</dc:creator><description>&lt;p&gt;Reviewer is a text field&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94743?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 16:19:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b2aa771b-6b0f-4293-8ed4-67ab996c83d3</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;What&amp;#39;s the CDT type definiton for the &amp;quot;reviewer&amp;quot; field here?&amp;nbsp; I can&amp;#39;t tell from the screenshot whether it&amp;#39;s anything more than plaintext.&lt;/p&gt;
&lt;p&gt;Thus I&amp;#39;m worried that when you&amp;#39;re trying to save the value of this field into your &amp;quot;selectedUsers&amp;quot; PV array, it&amp;#39;s failing to save any value because it&amp;#39;s trying to find a user with a username of, literally, &amp;quot;&lt;em&gt;oludare.olugbemi sylvester.ezeani; fakeuser&lt;/em&gt;&amp;quot;, and of course there is no user with that full string as its username.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94741?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 16:10:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5408039f-4339-4a24-9ebe-cdb05e735bc9</guid><dc:creator>oludareo0002</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1651853447629v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94737?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 15:28:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3867572b-038d-4946-9428-6e3e961b34fb</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;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.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94736?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 15:19:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:13b48cca-7c28-4f4a-81db-376c08efe190</guid><dc:creator>oludareo0002</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1651850097713v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;Type is user&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1651850277973v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;script task before the email to store reviewer variable into created process variable&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94669?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 13:42:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2cf8a33-cf9d-433c-9f6b-f7f5e5f1c558</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="87045" url="~/discussions/f/process/24477/send-email-to-array-of-users/94629#94629"]Tried this method however script task isn&amp;#39;t saving reviewer to selected users&amp;nbsp;[/quote]
&lt;p&gt;well, that means your problem isn&amp;#39;t in the send email node, for one thing.&amp;nbsp; As Naresh already said, please share the expression code where you&amp;#39;re attempting to set the value of pv!selectedUsers so we can help troubleshoot.&amp;nbsp; To confirm, are you saying that PV is ending up blank?&amp;nbsp; Or some other issue?&amp;nbsp; Can you confirm what type it is?&amp;nbsp; As in, is it &amp;quot;User&amp;quot; type with &amp;quot;multiple&amp;quot; selected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94630?ContentTypeID=1</link><pubDate>Thu, 05 May 2022 00:39:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbf9b233-ce49-4f94-8322-094655012f58</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;if possible con you share your code and screenshots of process configuration. It is difficult to answer whit out knowing what you have done&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94629?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 21:59:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ca731df0-92c7-4081-889a-63cff9ffe41a</guid><dc:creator>oludareo0002</dc:creator><description>&lt;p&gt;Tried this method however script task isn&amp;#39;t saving reviewer to selected users&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94469?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 22:08:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5904b2e6-610f-4680-adb1-3fc1da396a6a</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;If pv!reportRequest.reviewer is &lt;em&gt;user&lt;/em&gt;&lt;span style="text-decoration:underline;"&gt;&lt;/span&gt; type, I don&amp;#39;t think you even need to wrap it in &lt;em&gt;toEmailAddress()&lt;/em&gt;.&amp;nbsp; That function seems to only be needed when you want to target plaintext email addresses as recipients.&amp;nbsp; In fact it might be hurting you here, because if you wrap an &lt;em&gt;array of user&lt;/em&gt; in this function, it might accidentally be trying to treat their &lt;em&gt;&lt;strong&gt;usernames&lt;/strong&gt;&lt;/em&gt; as email addresses, which would definitely &lt;em&gt;&lt;span style="text-decoration:underline;"&gt;not work&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;/strong&gt;.&amp;nbsp; But again I&amp;#39;m not sure since you haven&amp;#39;t actually said what&amp;#39;s working / not working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94468?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 22:01:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5c7523cd-8abd-44d2-9e58-62fa98b76c12</guid><dc:creator>oludareo0002</dc:creator><description>&lt;p&gt;toemailaddress(pv!reportRequest.reviewer)&lt;br /&gt;&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1651528882564v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;and the reviewer variable just has the array of users with valid email addresses&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94457?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 21:15:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2e663b4b-0bae-4c3a-aa6b-abd67cbce149</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As Mike mentioned it is straight forward implementation. In your process add a process variable of type &lt;strong&gt;user&amp;nbsp;&lt;/strong&gt;(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&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;TO&amp;nbsp;&lt;/strong&gt;field using expression editor.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1651526070991v1.png" alt=" " /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/14/pastedimage1651526168723v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send email to array of users</title><link>https://community.appian.com/thread/94453?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 20:56:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cc7e99ce-87ec-44fd-a3d1-917fd3a77c41</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Can you share what you&amp;#39;ve already tried and what difficulty you&amp;#39;re having?&amp;nbsp; In general (assuming a valid array of users with valid email addresses) this is usually pretty straight forward, IIRC, because you can just target your user array in the &amp;quot;to:&amp;quot; field of the Send Email node.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>