<?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>How to fetch username out of Email address</title><link>https://community.appian.com/discussions/f/general/38206/how-to-fetch-username-out-of-email-address</link><description>Hi fellow devs, 
 There is a scenario where I have email address available to me like: &amp;quot;testuser@gmail.com&amp;quot; and this email address has some username at the backend like this: &amp;quot;Test_user&amp;quot;. 
 Now what I want to do is on the basis of email I want to fetch</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143849?ContentTypeID=1</link><pubDate>Mon, 23 Dec 2024 06:01:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:73d2277b-d453-458a-9e27-f53758b126da</guid><dc:creator>JayaPrakash Ravipati</dc:creator><description>[quote userid="105941" url="~/discussions/f/general/38206/how-to-fetch-username-out-of-email-address/143829"]me as &lt;a id="" href="mailto:sadia@test.com"&gt;sadia@test.com&lt;/a&gt;[/quote]
&lt;p&gt;you are trying to get the user details for the above mail id please check any user is available or no with &lt;a id="" href="mailto:sadia@test.com"&gt;sadia@test.com&lt;/a&gt;&amp;nbsp;email. If no user available the script task will return null&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143834?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 15:07:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cac78997-f96e-4835-aa55-dd6e79b93fb7</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="105941" url="~/discussions/f/general/38206/how-to-fetch-username-out-of-email-address/143829"]it seems like &amp;quot;from&amp;quot; process variable is getting passed as empty[/quote]
&lt;p&gt;That seems like a completely separate issue though.&amp;nbsp; Your initial post makes the assumption that we are starting with a &lt;em&gt;known&lt;/em&gt; initial address and needing to find the associated user.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But this addition makes it sound like it&amp;#39;s not even getting as far as getting the initial email, meaning it&amp;#39;s not even about finding the associated user account, but perhaps a configuration or execution issue related to how your process is getting launched.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143832?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 12:16:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1dc6f8ad-0bf3-469b-9ed9-a1bf38b1edc6</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Yes, why would it not?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1734696945219v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143831?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 12:13:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:734bda5f-89e7-496a-bca7-035f1567e83f</guid><dc:creator>Sadia_Rashid</dc:creator><description>&lt;p&gt;will it work if in value instead of hardcoded value i pass process variable that has email id? its not working in that case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143830?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 11:43:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f63962d-3223-4c74-b791-1a102c40b129</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;You could use the built-in User Record instead&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1734695001044v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143829?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 11:20:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1aac3aa8-f17c-4a0c-895c-847ef3bc20e4</guid><dc:creator>Sadia_Rashid</dc:creator><description>&lt;p&gt;Yes it works in the expression rule but in process model its not working. the process model starts as a result of email received. Like e.g:&amp;nbsp; I send email from my outlook to initiate the process model by mailing to&amp;nbsp;&lt;a id="" href="mailto:processmodel26840@snldev.appiancloud.com"&gt;processmodel26840@snldev.appiancloud.com&lt;/a&gt;&amp;nbsp;as a result in the process model there is one process variable &amp;quot;from&amp;quot; of type text that receives email id of the sender i.e: me as &lt;a id="" href="mailto:sadia@test.com"&gt;sadia@test.com&lt;/a&gt;&amp;nbsp;so in the script task i am using this &amp;quot;from&amp;quot; process variable to fetch username out of it using this getusersby() but it seems like &amp;quot;from&amp;quot; process variable is getting passed as empty.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143825?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 09:39:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d4d031d-231f-4a94-ba30-fac87f3e21c6</guid><dc:creator>gayatria0439</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/sadiar0001"&gt;Sadia_Rashid&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;Yes, you can use the &lt;code&gt;user()&lt;/code&gt; function by passing the email ID as an argument. This will allow you to retrieve first name, middle name, last name, display name (the user&amp;#39;s nickname), supervisor name, title, email, office phone, mobile phone, home phone, address lines 1-3, city, state, province, zip code, country, locale, time zone, custom fields 1-10, UUID, creation date, status, user type ID, and user type name. However, please note that the exact username cannot be retrieved using this function. Regarding the &lt;code&gt;getUsersBy()&lt;/code&gt; function, I am unable to obtain the expected output while using this function am also looking for the solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch username out of Email address</title><link>https://community.appian.com/thread/143824?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 09:23:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:15973f5f-7f25-4b01-a255-1e4cbe9fd24e</guid><dc:creator>JayaPrakash Ravipati</dc:creator><description>&lt;p&gt;HI&amp;nbsp;&lt;a href="/members/sadiar0001"&gt;Sadia_Rashid&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;Where are getting this email address. Because the function you gave is working fine.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please check how many users are created on the same email.&lt;/p&gt;
&lt;p&gt;Try the below code&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localvariables(
local!email:&amp;quot;testuser@gmail.com&amp;quot;,
local!userDetails:index(getusersby(local!email,3,1),1,null),
  user(local!userDetails,&amp;quot;firstName&amp;quot;)
  )&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>