<?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>Hi, i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/discussions/f/general/1152/hi-i-am-trying-to-fetch-user-group-name-from-a-group-name-constant-which-c</link><description>Hi, i am trying to fetch user/group name from a group name constant which can accept multiple values .On trying to fetching using the index number , i am just getting the first name , it is not reading the space . Could anybody help me with this ? ..</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Hi, i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/57381?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 07:14:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f3f71a8f-9ca4-40fd-867e-53c9524890d6</guid><dc:creator>Dharmendra Godhani</dc:creator><description>Hi Himanshu,&lt;br /&gt;
&lt;br /&gt;
First you need to find whether the value at an index is a group or user&lt;br /&gt;
To do this use runtimetypeof() function. It will return 4 if value is user and 5 if value is group.&lt;br /&gt;
Or you can use typename(runtimetypeof(XYZ[i])) which will return &amp;#39;User&amp;#39; or &amp;#39;Group&amp;#39; based on value.&lt;br /&gt;
If returned value is user then use user() function to fetch  properties like &amp;quot;firstName&amp;quot; , &amp;quot;lastName&amp;quot; &lt;br /&gt;
else value would be group.&lt;br /&gt;
&lt;br /&gt;
Note: use toUser() and toGroup() to convert.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/57374?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 06:09:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8093e0fa-d430-4682-8ff4-e2e90874bfe2</guid><dc:creator>Shubham Aware</dc:creator><description>Hi Himanshu,&lt;br /&gt;
&lt;br /&gt;
First you need to find particular value would be group or user&lt;br /&gt;
 --Use runtimetypeof() function to find&lt;br /&gt;
If user then use user() function and fetch using properties like &amp;quot;firstName&amp;quot; , &amp;quot;lastName&amp;quot; &lt;br /&gt;
else value would be group.&lt;br /&gt;
&lt;br /&gt;
Note: use toUser() and toGroup() to convert.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/57373?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 06:04:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:47255c29-42ea-477c-9bd1-f8b10a2ca2cb</guid><dc:creator>deviratnamv</dc:creator><description>Hi Himanshug,&lt;br /&gt;
&lt;br /&gt;
Below code try it once,&lt;br /&gt;
load(&lt;br /&gt;
  local!user:cons!BA_CONSTANT_OF_USERNAME,&lt;br /&gt;
  a!richTextDisplayField(&lt;br /&gt;
    value: a!richTextItem(&lt;br /&gt;
      text:&lt;br /&gt;
      a!forEach(&lt;br /&gt;
        items: local!user,&lt;br /&gt;
        expression: &lt;br /&gt;
       concat(user(username:fv!item,property:&amp;quot;firstName&amp;quot;),&amp;quot;  &amp;quot;,user(username:fv!item,property:&amp;quot;lastName&amp;quot;)) &lt;br /&gt;
        )&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/57370?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 05:21:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c4674178-c50a-49c8-8b34-c6b416cfea11</guid><dc:creator>shwetad</dc:creator><description>Hi Himanshu,&lt;br /&gt;
&lt;br /&gt;
Please try below code:&lt;br /&gt;
&lt;br /&gt;
if(runtimetypeof(cons!USER_OR_GROUP[2])=4,&lt;br /&gt;
concat(user(touser(cons!USER_OR_GROUP[1]),&amp;quot;firstName&amp;quot;),&lt;br /&gt;
&amp;quot; &amp;quot;,&lt;br /&gt;
user(touser(cons!USER_OR_GROUP[2]),&amp;quot;lastName&amp;quot;)),&lt;br /&gt;
group(togroup(cons!USER_OR_GROUP[2]),&amp;quot;groupName&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, the constant USER_OR_GROUP contains both user and groups, and its data type is user or group.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/57363?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 02:17:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:256c1a0d-2659-4a26-9a73-08f662bc6c31</guid><dc:creator>vinitav</dc:creator><description>&lt;p&gt;joinarray(&lt;br /&gt; apply(&lt;br /&gt; rule!APN_displayUser,&lt;br /&gt; getdirectgroupmemberuserspaging(&lt;br /&gt;local!ownerGroupId, /*pass the owner group id value here */&lt;br /&gt; 0,&lt;br /&gt; - 1&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; &amp;quot; , &amp;quot;&lt;br /&gt; ),&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/3984?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2013 12:45:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9eccfe27-5e50-46bd-9147-de549df60768</guid><dc:creator>Sathya Srinivasan</dc:creator><description>Please look at the user() function in Appian Documentation.&lt;br /&gt;Once you have a user object, you can obtain the full name (assuming first name + surname) by querying &amp;amp; concatenating the following attributes&lt;br /&gt;CONCAT(user(pv!user, &amp;quot;firstName&amp;quot;) ,&amp;quot; &amp;quot;,user(pv!user,&amp;quot;lastName&amp;quot;))&lt;br /&gt;&lt;br /&gt;The first name you mentioned you&amp;#39;re getting might simply be the user&amp;#39;s log-in name in your previous use case.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/3983?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2013 12:41:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c31d0d40-3942-44d0-bf91-42cca245ac94</guid><dc:creator>himanshug</dc:creator><description>@sathya : i want to fetch the entire name , but i am getting only the first name . How can i get the entire name&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/3982?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2013 11:59:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7f21a1bc-5676-4186-b37e-d4f4d97cdba7</guid><dc:creator>Sathya Srinivasan</dc:creator><description>First, ensure you have defined the constant as multiple and the values are separated by a semi-colon.  Secondly, use the INDEX function instead of the [] notation.  This is a fail safe to avoid errors when data doesnt exist in a particular index or if the value of the array is null.  Finally, when you are having a variable which is an array of User OR Group, you need to use the typeOf function to find out what type it is (for e.g. User is type 4) and once you know the datatype of the data you&amp;#39;re retrieved, you can perform actions on it, such as fetching the first name etc.,&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/3981?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2013 11:37:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e4090108-6886-4c42-8c85-0bf0aed8e745</guid><dc:creator>Arjun Devadas</dc:creator><description>XYZ is a multiple user or group variable. XYZ[index] would give the Appian username if the returned value is a user or the group id if the returned value is a group. You can use Appian user() function to retrieve First name and Last name from the returned username.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/3979?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2013 09:43:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3711ad4c-6fc3-4bc6-a90c-d279b5ef5b2c</guid><dc:creator>himanshug</dc:creator><description>my constant namely XYZ is an array type holding user or group member type and then i have a process variable which is also group type and when i retrieve XYZ[1], instead of getting  the full name i just get first name&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;i am trying to fetch user/group name from a group name constant which c</title><link>https://community.appian.com/thread/3967?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2013 17:06:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:735fbf32-d8b1-41c2-b353-0cedac096b5f</guid><dc:creator>Sathya Srinivasan</dc:creator><description>Can you add your code and sample data of what the constant holds?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>