<?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>Not getting constant value?</title><link>https://community.appian.com/discussions/f/general/25080/not-getting-constant-value</link><description>Hi Everyone, 
 
 if( 
 rimod1 = 2, 
 {cons!member1,cons!member2),{} 
 ) 
 
 In the above code I try to get the value from 2 constant which contain group member, but I am getting value from member1 not from member2. 
 can anyone help me on this.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97382?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2022 16:34:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bad7c0be-3b17-4898-b69f-5974a2e348ea</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="2401" url="~/discussions/f/general/25080/not-getting-constant-value/97379#97379"]only displaying users read-only[/quote]
&lt;p&gt;OP never said this (or really anything like it) beyond perhaps some incorrect assumptions in earlier replies.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href="/discussions/f/general/25080/not-getting-constant-value/97288#97288"&gt;this comment&lt;/a&gt;, where they [eventually] clarified a bit,&lt;/p&gt;
[quote userid="58556" url="~/discussions/f/general/25080/not-getting-constant-value/97288#97288"]I am using&amp;nbsp;&lt;span&gt;a!pickerFieldUsers() in interface, where I am trying to get values from two constant which contains groups. I want to display all the value present in two groups and from that only user can select only one user.&lt;/span&gt;[/quote]
&lt;p&gt;My personal translation of this (going for what they&amp;nbsp;&lt;em&gt;mean,&lt;/em&gt; rather than their &lt;em&gt;exact wording&lt;/em&gt;, that is) is something like the following:&lt;br /&gt;&lt;em&gt;&amp;quot;I am using a!pickerFieldUsers(), and want to allow it to select from among 2 distinct groups that I&amp;#39;m referencing using two constants, to allow the form user to make a single selection.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;To which the answer is (as i &lt;a href="/discussions/f/general/25080/not-getting-constant-value/97291#97291"&gt;posted before&lt;/a&gt;), OP needs to create a designated Parent Group to contain both target groups in question, and refer to that one in the picker field.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97379?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2022 15:58:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1c171de2-f5b0-4cd3-af6e-1a6a264d136a</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;This thread is intriguing.&amp;nbsp; My current questions are:&lt;/p&gt;
&lt;p&gt;If you are only displaying users read-only, why do you need to do it in a picker field (vs a text field)?&lt;/p&gt;
&lt;p&gt;Does this not work for you?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!pickerFieldUsers(
  label: &amp;quot;Users&amp;quot;,
  readOnly: true,
  value:getdistinctusers({
    cons!member1,
    cons!member2
  })
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97312?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2022 07:44:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6edf9f7e-c15e-4990-b6f4-c66e53fab671</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;But then, this is what the value parameter of the field is used for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97308?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2022 06:20:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eb31844a-5c48-4525-9519-575f91c0a9fc</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;yes you are right &lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97295?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 20:06:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:13a8c1d1-acaf-4d08-909c-36d1a892e134</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;To me this sounds like a great case for a!dropdownField() populated from 2 groups, with it&amp;#39;s built-in search capability.&amp;nbsp; Assuming the use case is #1, which is not yet clear here.&lt;/p&gt;
&lt;p&gt;1) Select a single user from a list of users who are in one of 2 groups&lt;/p&gt;
&lt;p&gt;2) Select a group (hence the pickerFieldGroups?), but have the members on display in a component nearby?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97293?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 19:33:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e2b442b6-4490-4cad-ae4b-690dee8bf6cc</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="59361" url="~/discussions/f/general/25080/not-getting-constant-value/97292#97292"]why you try to use a user picker field to display users[/quote]
&lt;p&gt;Consider that he might just be trying to ["see"] a certain set of users in the picker field, in the sense of the standard use case for the user picker field. That&amp;#39;s my reading here.&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1657049627520v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97292?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 19:04:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:29976173-60a5-4174-bb30-2ee1c24dca8c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I still do not understand why you try to use a user picker field to display users. While possible this does not make a great UI.&lt;/p&gt;
&lt;p&gt;Have a look at the below pattern and replace the code in line 7 with the working code i posted.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/22.2/user-list-pattern.html"&gt;docs.appian.com/.../user-list-pattern.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97291?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 18:56:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e31fc387-bff3-4af3-9a38-9198eeadac2e</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;as Stefan pointed out, the groupFilter parameter only accepts a single group input.&amp;nbsp; If you want to allow your User Picker to access users from both groups, then you&amp;#39;ll need to create a parent group with both of those groups as members, and point the picker field at that parent group instead.&amp;nbsp; (You can wrap it in the same if() logic to check for the value of ri!pnrNo if you like).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97288?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 18:40:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1e90b024-9247-4627-bb7a-c41f75a39368</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;I am using&amp;nbsp;&lt;span&gt;a!pickerFieldUsers() in interface, where I am trying to get values from two constant which contains groups. I want to display all the value present in two groups and from that only user can select only one user.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;a!pickerFieldUsers(&lt;br /&gt; maxSelections: 1,&lt;br /&gt; groupFilter: if(&lt;br /&gt; ri!pnrNo =2,&lt;br /&gt; {cons!member1,cons!member2},{}&lt;br /&gt; )&lt;br /&gt;)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97286?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 18:31:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:41328af1-4212-4c1d-a7d2-7d38aea563e1</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;[assuming they're still trying to use a!pickerFieldGroups(), though i'm unclear on how or why.]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97284?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 18:28:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4b2b2cc5-7f76-4a7e-8d26-26b2f1f2eb33</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;More details please! What do you try to do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97282?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 17:52:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c12b170b-4334-4bb9-a1f6-1a1943c43715</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;I have tried the above code in expression rule and I am able to get all the value. When I am using the above code in Interface that time it is throwing error i.e &amp;quot;Could not cast user to group&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97281?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 17:31:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:afa30cb1-3e53-4d8b-af67-d402fa817c35</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Does that code snippet work or not. It cannot work and also throw an error. More details please.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97277?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 17:12:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:631abe1e-43f6-4f89-ba11-e220b015f107</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;The above code&amp;nbsp; is working&amp;nbsp; and able to get the all the value from both the constant, but it is throwing Cast Invalid error &amp;quot;Could not cast user to group&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97214?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 06:07:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:81a6edb6-bd35-4df0-9544-1f7864723c8e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I already mentioned the getdistinctusers() function above. Try something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
  items: getdistinctusers({cons!EOM_GROUP_ADMINS, cons!EOM_GROUP_GLOBAL_RISK}),
  expression: concat(
    user(fv!item, &amp;quot;firstName&amp;quot;),
    &amp;quot; &amp;quot;,
    user(fv!item, &amp;quot;lastName&amp;quot;)
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97211?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 19:57:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c5a19e2d-c081-4099-9b2c-8d11eea113ac</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;&lt;span&gt;&amp;nbsp;I want to display the members of both groups. How to do it ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97210?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 17:27:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bbfa995d-96b9-41b1-b3c2-09263c40e977</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Do you want to display the members of both groups, or do you want to select users from both groups?&lt;/p&gt;
&lt;p&gt;As I already wrote, this field only accepts a SINGLE group.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97209?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 17:25:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:679afd9e-86dc-42d9-ac83-985330b8bcd0</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;Here I want to display member from both the group, as of now it is showing only member belongs to member 1 only.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97208?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 17:08:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7cf79e4c-15f3-4d37-bcf6-59b7cf118d1c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You saw that this field only accepts a single group as filter?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97207?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 16:59:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7971dd11-3498-4721-91ba-bbcf1f788560</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;a!pickerFieldGroups(&lt;br /&gt; label: &amp;quot;TEST&amp;quot;,&lt;br /&gt; groupFilter: if(&lt;br /&gt; ri!mod1 = 2,&lt;br /&gt; {cons!member1, cons!member2},{}&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;this is the code, where I am getting only member1 value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97206?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 16:25:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:749e1951-b7b4-4404-99ff-134ed11bf9c4</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;OK, can you post a screenshot?&lt;/p&gt;
&lt;p&gt;I assume that your constants are both of type Group. Now what do you expect as the output? The users being member of these groups? If this is the case, use the following function get them.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/22.2/fnc_people_getdistinctusers.html"&gt;docs.appian.com/.../fnc_people_getdistinctusers.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97205?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 16:21:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:523709ed-a76d-4360-bf0d-00d07b73acaf</guid><dc:creator>minhajk0001</dc:creator><description>&lt;p&gt;yes right  empty list for other value, but I am able to get the value from cons!member1 .&lt;/p&gt;
&lt;p&gt;Here I try to get get value from both cons!member1 &amp;amp; cons!member2 if ri!mod=2.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not getting constant value?</title><link>https://community.appian.com/thread/97204?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 16:17:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:23471b6d-a834-488a-893d-ef112caef2a3</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Can you describe which outputs you get for your inputs?&lt;/p&gt;
&lt;p&gt;I would expect that for ri!mod1 = 2 you get a list of groups. And empty list for any other value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>