<?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>Expression to convert [Group:##] into text</title><link>https://community.appian.com/discussions/f/rules/1528/expression-to-convert-group-into-text</link><description>is there an expression to convert this value: [Group:##] into a text field? Our process analytics report saves task assignees as text when they are people and [Group:##] when they are groups, and we are trying to show the text name of the group in a paging</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/63195?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 12:57:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f6f53def-a599-4598-b698-9ee8a93e953d</guid><dc:creator>neelimaj328</dc:creator><description>HI,&lt;br /&gt;
&lt;br /&gt;
You can use the below code. I have used the same in my project.&lt;br /&gt;
&lt;br /&gt;
Create a below rule and use this in forEach expression in your gridTextColumn component.&lt;br /&gt;
&lt;br /&gt;
if(&lt;br /&gt;
  rule!APN_isEmpty(&lt;br /&gt;
    ri!usrOrGrp_txt&lt;br /&gt;
  ),&lt;br /&gt;
  null,&lt;br /&gt;
  if(&lt;br /&gt;
    rule!APN_isEmpty(&lt;br /&gt;
      togroup(&lt;br /&gt;
        ri!usrOrGrp_txt&lt;br /&gt;
      )&lt;br /&gt;
    ),&lt;br /&gt;
    rule!getFullNameFromUsername(&lt;br /&gt;
      ri!usrOrGrp_txt&lt;br /&gt;
    ),&lt;br /&gt;
    if(&lt;br /&gt;
      doesgroupexist(&lt;br /&gt;
        tointeger(&lt;br /&gt;
          ri!usrOrGrp_txt&lt;br /&gt;
        )&lt;br /&gt;
      ),&lt;br /&gt;
	  group(&lt;br /&gt;
          tointeger(&lt;br /&gt;
            ri!usrOrGrp_txt&lt;br /&gt;
          ),&lt;br /&gt;
          &amp;quot;groupName&amp;quot;&lt;br /&gt;
        ),&lt;br /&gt;
      rule!getFullNameFromUsername(&lt;br /&gt;
        ri!usrOrGrp_txt&lt;br /&gt;
      ))))&lt;br /&gt;
&lt;br /&gt;
***************************&lt;br /&gt;
Where rule!getFullNameFromUsername is as below:&lt;br /&gt;
&lt;br /&gt;
***************************&lt;br /&gt;
	   if(&lt;br /&gt;
    rule!APN_isEmpty(&lt;br /&gt;
      ri!username_txt&lt;br /&gt;
    ),&lt;br /&gt;
    null,&lt;br /&gt;
    if(isusernametaken(ri!username_txt),&lt;br /&gt;
  user(&lt;br /&gt;
    ri!username_txt,&lt;br /&gt;
    &amp;quot;firstName&amp;quot;&lt;br /&gt;
  ) &amp;amp; &amp;quot; &amp;quot; &amp;amp; user(&lt;br /&gt;
    ri!username_txt,&lt;br /&gt;
    &amp;quot;lastName&amp;quot;&lt;br /&gt;
  ),null)&lt;br /&gt;
  )&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
J. Neelima&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/63171?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2018 03:58:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:21ae6c73-8f88-4ecc-a46d-6cc5da1fa22d</guid><dc:creator>josep</dc:creator><description>Hello &lt;br /&gt;
&lt;br /&gt;
In case you can set the variable you are getting out of the report, If the variable is single value “User or Group” something like this might help. &lt;br /&gt;
&lt;br /&gt;
if(runtimetypeof(ri!groupOrUser) = tointeger(&amp;#39;type!{&lt;a&gt;www.appian.com/.../2009}Group&amp;#39;),&lt;/a&gt;&lt;br /&gt;
  group(togroup(ri!groupOrUser), &amp;quot;groupName&amp;quot;),&lt;br /&gt;
  rule!APN_displayUser(touser(ri!groupOrUser))&lt;br /&gt;
)&lt;br /&gt;
If you have multiple, that is a different story &lt;br /&gt;
&lt;br /&gt;
——SOME OTHER IDEA——&lt;br /&gt;
=with(&lt;br /&gt;
  local!array: split(stripwith(ri!text, &amp;quot; &amp;quot;), &amp;quot;;&amp;quot;),&lt;br /&gt;
  if(isnull(ri!text), {},&lt;br /&gt;
    {&lt;br /&gt;
      if(ri!returnType=&amp;quot;USER&amp;quot;, {},&lt;br /&gt;
        togroup(  extract( ri!text, &amp;quot;[Group:&amp;quot;, &amp;quot;]&amp;quot;) )&lt;br /&gt;
      ),&lt;br /&gt;
      if(ri!returnType=&amp;quot;GROUP&amp;quot;, {},&lt;br /&gt;
        touser(index(local!array, &lt;br /&gt;
        where(apply(isusernametaken( _), local!array)), {}))&lt;br /&gt;
      )&lt;br /&gt;
    }&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
————&lt;br /&gt;
&lt;br /&gt;
I Hope this helps &lt;br /&gt;
Jose&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/63161?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 20:15:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e8e8c982-54f9-4628-b2fa-b0601c22f2e1</guid><dc:creator>ManuelHTG</dc:creator><description>Hi,&lt;br /&gt;
I had once a similar problem and I realized much after of the mistake. I would suggest to review your CDT and make sure that you have a number and not a text. Group should be an integer on the DB level, and if you save it as a text, then you will have something like [Group:##]. With a number, all the suggestions from below to transform should work, and you should not need that transformation you a seeking for.&lt;br /&gt;
&lt;br /&gt;
I hope it is of help,&lt;br /&gt;
Good luck!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/9165?ContentTypeID=1</link><pubDate>Tue, 06 May 2014 18:32:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:029fd29b-032f-4ae0-b7e9-4681b323ea2b</guid><dc:creator>evan.rust</dc:creator><description>What is the definition of your report column?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/9161?ContentTypeID=1</link><pubDate>Tue, 06 May 2014 14:15:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8100a169-81e5-4711-b262-d90592d1f60d</guid><dc:creator>mandeepk</dc:creator><description>Please suggest.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/9160?ContentTypeID=1</link><pubDate>Tue, 06 May 2014 14:15:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a02dba38-628a-4659-b8e7-72bad5bbb7ba</guid><dc:creator>mandeepk</dc:creator><description>I have tried everything mentioned above , but i am unable to resolve [Group:##] in my paging grid text column.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/5438?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2013 18:47:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2468932f-0c78-409d-8b5d-bfe658ad99c9</guid><dc:creator>fabienb</dc:creator><description>In fact, I think that there is a problem w/ tp!assignee and tp!task_assignee_owner()  outputs as the result blanks when we do function(tostring(tp!task_assignee_owner() )).&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/5433?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2013 17:04:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7efd2471-321e-4034-a75f-928211e9850e</guid><dc:creator>normanc</dc:creator><description>Have you tried the togroup() function? e.g...&lt;br /&gt;=if(left(ri!myString,1)=&amp;quot;[&amp;quot;,&lt;br /&gt; group(togroup(ri!myString),&amp;quot;groupName&amp;quot;),&lt;br /&gt; ri!myString)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/5427?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2013 11:56:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3cbc13c0-68b4-4e39-b985-3c1518c732af</guid><dc:creator>fabienb</dc:creator><description>I had a very similar issue recently. It is not very clean but I used =if(find(&amp;quot;Group&amp;quot;,ri!texte)&amp;gt;0,group(tointeger(mid(ri!texte,8,len(ri!texte)-1)),&amp;quot;groupName&amp;quot;),ri!texte)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Expression to convert [Group:##] into text</title><link>https://community.appian.com/thread/5426?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2013 11:24:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:77f0f58d-da19-4573-b9da-8c28f47ac660</guid><dc:creator>sudharanid</dc:creator><description>I think group() function helps in your case.For more details &lt;a href="https://forum.appian.com/suite/wiki/73/Scripting_Functions#group.28.29"&gt;forum.appian.com/.../Scripting_Functions&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>