VA Topic - Myself or onbehalf

Khanna Ji
Tera Guru

Hi Team,

 

I am building a VA topic where my first question to ask user is wether this issue being reported for self or somebody else. If its self then caller must be filled in with logged in user and if its onbehalf then a referece picker must be given to allow user to select one. 

 

At the end caller field must be filled in correctly.

 

Has anybody done this? Need ideas for it please.

2 REPLIES 2

NatrajS93604625
Tera Expert

Hi @Khanna Ji ,

 

Step 1: Select the user input node as choice and Ask Question "Is this request for yourself or on behalf of someone else?" and create your choices (Self and On behalf). Then store this question value in the variable (req_for_whom)

Step 2: Add the decision node to validate the request is for self or someone else.
Step 3: Add Branch node and validate If it is for self store the logged in user value in (

vaVars.caller = vaSystem.getUserID();

)
Step 4: If it is for Someone else add a node (type = reference, table = sys_user, Question = Who is this request for?) and store this value in "caller_id" field.
Step 5:Based on the previous selection the caller_id value will be filed in automatically based on the selection.

If this response was helpful, please consider marking it as Correct and Helpful. You may mark more than one reply as an accepted solution.

vaishali231
Tera Guru

hey @Khanna Ji 

You need to:

  1. Ask user - Is this for yourself or someone else?
  2. Based on answer:

Self - auto-set Caller = logged-in user

On behalf - show reference picker

  1. Ensure Caller is correctly populated at the end

  Approach (VA Topic Design)

1. Create First Question (Choice Input)

Add a User Input node:

  • Question: “Is this request for yourself or someone else?”
  • Variable name: request_type
  • Choices: self , on_behalf

 

2. Handle "Self" Scenario

Add a Condition Node:

If request_type == 'self'

Then set variable using Set Variable node:

caller_id = {{vaContext.user.sys_id}}
 vaContext.user.sys_id = logged-in user

 

3. Handle "On Behalf" Scenario

Add another branch:

If request_type == 'on_behalf'

Then:

  • Add User Input node
  • Type: Reference
  • Table: sys_user
  • Variable: requested_for_user

4. Map Caller Field at the End

Before record creation :

 Set Variable / Script Step:

if (topic.variables.request_type == 'self') {
   topic.variables.caller_id = vaContext.user.sys_id;
} else {
   topic.variables.caller_id = topic.variables.requested_for_user;
}

 

*************************************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh