Saving logged in person name on form


Hi,

 

I have created a workflow in K2 studio. Workflow has 6 levels of approval. In my smart form, I need to capture the logged in user name and approval date for each approval level (see the loggedInUserNameDate attachment ). In loggedInUserNameDate attachment, Employee Manager and IT (Director/CTO/ or...) should pick the logged in user name and Approval date. For this I created views in designer. In views I used data label control for user name and approval Date. In Edit form for each workflow activity I am putting rule to show display name and current date if control does not contain any value (see the editFormRuleExample attachment) else put the values from smartobject. But Form is not able to capture logged in user name and Approval Date.

Any suggestions how can this be done?

 

Thanks,

Mohini


12206iE782CEE14F58A451.png
13362iD3D06F1E538BF2CC.png


3 replies

Badge +7
Hey!

Just define expression in each of those two controls to capture the logged in username and date. This will always bring the current user name and current date hence you can seriously considering removal of else block.
Badge +9

Hi msharma,

 

You can get Current logged in user and time from context browser.

 

 

 

This you can access by either setting rule when view initialized, configure control property or either during submit pass these values to input parameter.

 

 

let me know, if this helps you

 

 

 

Badge +8

msharma,

The way I accomplish this is by creating a SQL table called "Comments and History". Every time the form is rejected, approved, or reworked it updates this list with the comments of the approver, a form status (The action taken i.e "Rejected by VP or Approved by Supervisor, Rework requested by Manager") , a modified date, and modified by.

 

When the form is submitted I make sure Modified date and Modified by are pulling from the current date and the current user. The SQL looks like this.

 

CREATE TABLE COMMENTS_HISTORY
 

(

ID int IDENTITY(1,1) PRIMARY KEY,

Process_ID int,

Comments varchar(max),

FormStatus varchar(50),

Modified datetime,

ModifiedBy varchar(50)

)

 

Once created I create a list view and drag it into my form. I then map the ID from the main entry form to the process ID field. This way I can call the comments where the process ID matches the ID for the current entry.

 

I hope this helps. Let me know if you need more guidance.

 

Thanks,

Bryan Peters

Reply