<?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>User existence check</title><link>https://community.appian.com/discussions/f/rules/8898/user-existence-check</link><description>Is there any other way to check user existence in the appian except with persisted value in table? OriginalPostID-248067</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: User existence check</title><link>https://community.appian.com/thread/152381?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2025 16:24:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3c7e837d-91ec-4120-9fe1-e536b01298d7</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="241979" url="~/discussions/f/rules/8898/user-existence-check/152367"]is there any other way to achieve this?[/quote]
&lt;p&gt;zombie thread much?&amp;nbsp;&amp;nbsp;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f61b.svg" title="Stuck out tongue"&gt;&amp;#x1f61b;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But in all seriousness - With the current state of the User Record, I&amp;#39;ve found that the best (and arguably fastest) username-checking routine is now to use a custom-built expression rule that queries said Record type.&amp;nbsp; It&amp;#39;s also the only solution I&amp;#39;ve found that treats the username as case-insensitive enough to work without laborious other bending-over-backwards workarounds (like you need to use with the &amp;quot;isUsernameTaken()&amp;quot; and &amp;quot;isusernameavailablefornewaccount()&amp;quot; type rules).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!username: a!defaultValue(trim(ri!username), &amp;quot;-=-=-&amp;quot;),
  
  local!userQuery: a!refreshVariable(
    refreshAlways: true(),
    value: if(
      local!username = &amp;quot;-=-=-&amp;quot;,
      a!map(totalCount: 0),
      a!queryRecordType(
        recordType: &amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User&amp;#39;,
        pagingInfo: a!pagingInfo(1, 1),
        fetchTotalCount: true(),
        fields: {&amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username&amp;#39;, &amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_active}active&amp;#39;, &amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_uuid}uuid&amp;#39;},
        filters: a!queryLogicalExpression(
          operator: &amp;quot;OR&amp;quot;,
          filters: {
            /* doing this to rule out lowercase username first, as it&amp;#39;s the normal way we try to initialize them */
            a!queryFilter(
              field: &amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username&amp;#39;,
              operator: &amp;quot;=&amp;quot;,
              value: lower(local!username)
            ),
            a!queryFilter(
              field: &amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username&amp;#39;,
              operator: &amp;quot;=&amp;quot;,
              value: local!username
            )
          },
          logicalExpressions: {
            a!queryLogicalExpression(
              operator: &amp;quot;AND&amp;quot;,
      
              /* these will require the username to match exactly except for casing */
              filters: {
                a!queryFilter(
                  field: &amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username&amp;#39;,
                  operator: &amp;quot;starts with&amp;quot;,
                  value: local!username
                ),
                a!queryFilter(
                  field: &amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username&amp;#39;,
                  operator: &amp;quot;ends with&amp;quot;,
                  value: local!username
                )
              }
            )
          }
        )
      )
    )
  ),
  
  /* tool written by: Mike Schmitt */
  
  if(
    local!userQuery.totalCount = 0,
    a!map(
      exists: false(),
      username: if(local!username = &amp;quot;-=-=-&amp;quot;, &amp;quot;(none provided)&amp;quot;, local!username)
    ),
    a!map(
      exists: true(),
      username: tostring(local!userQuery.data[&amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_username}username&amp;#39;]),
      uuid: local!userQuery.data[1][&amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_uuid}uuid&amp;#39;],
      isActive: local!userQuery.data[1][&amp;#39;recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_active}active&amp;#39;]
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;invalid username:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/pastedimage1762878313296v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;active (test) user:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/pastedimage1762878368339v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;inactive user:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/pastedimage1762878406840v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;same user but with mismatched casing:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/15/pastedimage1762878481281v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User existence check</title><link>https://community.appian.com/thread/152367?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2025 17:53:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0dc7da84-a60e-4daf-a5fc-caa693531289</guid><dc:creator>Jose Castellot</dc:creator><description>&lt;p&gt;in version 24.4 isuseractive function is not available, is there any other way to achieve this? I just want to validate if user is acitve or deactivated or even if doesn&amp;#39;t exist anymore in the system, we are trying to validate the scenario if for any reason the user saved in DB was deactived or deleted from the system, cause currently we are saving the result of calling the funcion loggedInUser() in DB, this is storing a text value, however we have the requirement to display the fisrtName and lastName of the user in the frontend, therefore we would like to catch the invalid user exception assuming the user was deactivated, since we don&amp;#39;t have a try-catch similiar function in version 24.4, we want to know if there is any other way to catch the exception or change the approach following your recomendations. Any help will be greatly appreciated, thanks and regards!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User existence check</title><link>https://community.appian.com/thread/39534?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2016 09:55:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5e601c4b-fdaa-4e45-a44b-00e2a6ce1a75</guid><dc:creator>rajasekhard</dc:creator><description>Welcome :)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User existence check</title><link>https://community.appian.com/thread/39533?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2016 09:42:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:acbd01dc-6e7d-471c-a299-976baa0af61a</guid><dc:creator>Dastagiri Dudekula</dc:creator><description>Thank you brother&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User existence check</title><link>https://community.appian.com/thread/39532?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2016 09:20:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04c92e14-76ce-4a85-9522-a2c788da1ab2</guid><dc:creator>rajasekhard</dc:creator><description>Can you use one of the following functions based on the requirement?&lt;br /&gt;&lt;br /&gt;1. isuseractive - Returns true if a given username represents an active user account.&lt;br /&gt;2. isusernametaken - Returns true if a user (active or deactivated) with the specified username (case-sensitive) exists in the system, indicating that the username is taken. Returns false otherwise. &lt;br /&gt;3. isusernameavailablefornewaccount - Returns whether a username can be used to create a new account&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>