<?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 get the currently logged in users into an application</title><link>https://community.appian.com/discussions/f/user-interface/20848/how-to-get-the-currently-logged-in-users-into-an-application</link><description>I want my interface to show the currently logged in users for application in the text field. Can someone please help in getting the solution for this ?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81222?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 17:07:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f004474d-abe9-42f5-8429-0568ef716f76</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Agree with Stefan there isn&amp;#39;t really anything OOTB to satisfy your requirement here.&amp;nbsp; However you may be able to utilize the &lt;a href="/b/appmarket/posts/execute-stored-procedure"&gt;Execute Stored Procedure&lt;/a&gt; plugin to record users interacting with the form, then display the stored data within the form itself, to show which users are logged in.&lt;/p&gt;
&lt;p&gt;Note, the plugin&amp;#39;s&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;function&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;b&gt;fn!executestoredprocedure()&amp;nbsp;&lt;/b&gt;is not designed to modify data, which is noted on the App Market page.&amp;nbsp; However, I have used it to successfully to record auditing/logging type data in similar situations.&amp;nbsp; I cannot speak to if the function will be modified in the future to physically prevent this.&amp;nbsp; But, this example will update a login data set each time the a!textField() is interacted with.&amp;nbsp; In a short time playing with it today, I was not able to get the auto-refresh to work (intended to have it update every 30 seconds, automatically), but it is refreshing correctly based on&amp;nbsp;&lt;em&gt;refreshOnVarChange&lt;/em&gt;, in which you can set any variables that users interact with.&lt;/p&gt;
&lt;p&gt;Created on Appian 20.3, MSSQL database.&lt;/p&gt;
&lt;p&gt;Table:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="sql"&gt;CREATE TABLE [dbo].[test_login_audit](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[user] [varchar](100) NULL,
	[loginTime] dateTime NULL
) ON [PRIMARY]
GO
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Stored Procedure, results in one row per user with the latest form interaction time:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="sql"&gt;CREATE PROCEDURE [dbo].[test_usp_login_audit] 
	@user varchar(100),
	@loginTime dateTime
AS
BEGIN
	DECLARE @count int = (SELECT COUNT(*) FROM dbo.test_login_audit WHERE [user]=@user)
	
	IF @count = 0
	BEGIN
		INSERT INTO dbo.test_login_audit ([user],loginTime) VALUES (@user,@loginTime)
	END 
	ELSE
	BEGIN
		UPDATE dbo.test_login_audit set loginTime = @loginTime WHERE [user]=@user
	END


	SELECT loginTime from dbo.test_login_audit WHERE [user]=@user
END
GO
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Interface, this will log an interaction on load and any time the Test Field is modified:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!testField,
  local!audit: a!refreshVariable(
    value: fn!executestoredprocedure(
    dataSourceName: &amp;quot;java:comp/env/jdbc/YOUR_DB_CONNECTION&amp;quot;,
    procedureName: &amp;quot;dbo.test_usp_login_audit&amp;quot;,
    inputs: {
      {name: &amp;quot;user&amp;quot;, value: tostring(fn!loggedInUser())},
      {name: &amp;quot;loginTime&amp;quot;, value: now()}
    }
  ),
  /*refreshInterval: 0.5,*/
  /*refreshAlways: true,*/
  refreshOnVarChange: local!testField
  ),
  {
    a!textField(
      label: &amp;quot;Audit Result&amp;quot;,
      value: local!audit,
      readOnly: true
    ),
    a!textField(
      label: &amp;quot;Test Field&amp;quot;,
      value: local!testField,
      saveInto: local!testField
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81213?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:43:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1fb70f2a-9d4d-4119-8018-93e60d92ebcc</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;AFAIK not OOTB. Would need some digging into Appian Java API and if there is something available (see deprecated plugin above) a custom plugin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81211?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:41:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbb4b4e6-8ebb-4a9d-8a72-f664267fe881</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;no idea on what they are going to do with this info..... for now how can I retrieve the count is the main problem....any possible means of doing it ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81210?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:38:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c3d3f3da-46ea-49ac-809a-d755cbe1df1c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Do you know what they do with this information?&lt;/p&gt;
&lt;p&gt;Number of group members is not good enough?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81209?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:37:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d8857e79-be06-46c1-8ccc-579d4beddcd7</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;I need to display the count of logged in users of different groups in a tabular format in my interface. Its a part of customer requirement. They need to know how many users are currently logged in to the application using interface.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81208?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:35:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d5406878-5c73-4fd3-834b-be5214e59160</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Not OOTB. Maybe there is a Java API available.&lt;/p&gt;
&lt;p&gt;Why do you need this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81207?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:34:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4b199ef9-1dc9-4eb6-a5d7-a951df4bcd85</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;are there not any other alternatives to find out all the logged in users in appian ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81206?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:33:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ef64c0e2-995a-44db-ab30-3069ae9cbf53</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This information is not directly available. The log file login-audit.csv is as close as you can get to information about logins. The plugin&lt;/p&gt;
&lt;p&gt;&lt;a href="/b/appmarket/posts/user-login-details"&gt;https://community.appian.com/b/appmarket/posts/user-login-details&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;seems to not work anymore.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81205?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 13:25:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:844e4bda-fff3-4a3d-a01e-d99147e17993</guid><dc:creator>amangupta</dc:creator><description>&lt;p&gt;HI Stefan,&lt;/p&gt;
&lt;p&gt;The function only provide the current logged in user but not the list of all users who have logged into the application. I need to display the count and name of all users who use particular application&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the currently logged in users into an application</title><link>https://community.appian.com/thread/81202?ContentTypeID=1</link><pubDate>Tue, 27 Apr 2021 12:55:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:079c617f-7d79-4c31-94bc-3378f080b279</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;span style="font-family:inherit;"&gt;There is a function for this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;a href="https://docs.appian.com/suite/help/21.1/fnc_people_loggedinuser.html"&gt;docs.appian.com/.../fnc_people_loggedinuser.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>