+44(0)1908 545 770
YOUR EXPERT RPA PARTNER

Team up with our RPA strategy and tech specialists for maximum automation impact

Find out more
Harness the power of UiPath in your business.
WATCH NOW

Save money and spend more time on priority work.

Book consultation
READY, SET, AUTOMATE

Let's choose, design and deploy a process automation solution for your business.

Find out more
TRANSFORM YOUR BUSINESS

Let's analyse your business to discover opportunities for innovation and automation.

Find out more

Begin your business transformation journey

Book consultation
AUTOMATE EVERY FUNCTION

Automate where it matters most. Scale to solve challenges in every area

Find out more
GIVE EVERY TEAM THE TOOLS FOR SUCCESS

Equip people with user-friendly solutions that save time and make work easier

Find out more

Which business problem
can we solve first?

Book consultation
15 November 2014

How to set a “Welcome back, User’s Name” on a K2 SmartForm App’s Header

It is good practice to display the logged-in user’s username somewhere in an application after login.  This is an indication that the system authenticated them correctly, and they are interacting with the system with the correct credentials.  This also makes system testing easy, especially if multiple users need to be used to test role specific features.

K2 SmartForms - Display Users Name - Workspace example

K2 SmartForms – Display Users Name – Workspace example

 

[vc_row full_width=”stretch_row” css=”.vc_custom_1513096286740{background-color: #a3a3a3 !important;}”][vc_column width=”2/3″][vc_column_text]

K2 Automated Testing Software

BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.

DOWNLOAD NOW[/vc_column_text][/vc_column][vc_column width=”1/3″][vc_single_image image=”12755″ img_size=”medium” alignment=”right”][/vc_column][/vc_row]

 

Free K2 Five Upgrade Review

 

For example, in ASP.NET, the user object can be used to set the value of a label in a masterpage.  This means that every page in the system that is mastered by this page will display the user’s name when an application page is rendered.

In K2 SmartForms, a similar technique is used, but it can be implemented without writing any code.  The technique involves creating a K2 smartform data label and setting an expression on it.

The first thing to do is identify the location of the welcome message.  The top right hand section of the header of the K2 SmartForm application is a popular location.  Next, drag a K2 data label to this position and name it Welcome Message Data Label.

K2 SmartForms - Display Users Name - Add Data label

K2 SmartForms – Display Users Name – Add Data label

Next, click on the K2 data label and then the ellipses next to the K2 expression control.

K2 SmartForms - Display Users Name - Add Data label expression

K2 SmartForms – Display Users Name – Add Data label expression

Click on the Add button to create a new K2 expression to be associated with the K2 data label and give it a name.

K2 SmartForms - Display Users Name - Add Expression

K2 SmartForms – Display Users Name – Add Expression

Click on the Operators tab, open the Text node and drag the concatenate expression to the left hand side.

K2 SmartForms - Display Users Name - Add Concatenation Operator

K2 SmartForms – Display Users Name – Add Concatenation Operator

Type in “Welcome back, ” in the first parameter of the expression.

K2 SmartForms - Display Users Name - Add Welcome Text

K2 SmartForms – Display Users Name – Add Welcome Text

With the Context tab selected, drag the Current User’s display name from the System Values node to the second parameter of the concatenate expression.  The K2 SmartForm runtime will automatically replace this with the currently logged in user’s name.  Click OK and once again to return to the properties window of the K2 data label.

K2 SmartForms - Display Users Name - Add Display Name

K2 SmartForms – Display Users Name – Add Display Name

Save the K2 SmartForm and run it again.

K2 SmartForms - Display Users Name - Welcome Message Integrated

K2 SmartForms – Display Users Name – Welcome Message Integrated

Notice the user’s display name is automatically concatenated with the welcome message.  Now when the user logs in, their name is displayed on every K2 SmartForm in the system.

 

Need further technical advice or support?

Contact Us