Page 1 of 1
Job filters in Switch Portal (Filter by current user) [solved]
Posted: Fri Dec 02, 2022 1:50 pm
by magnussandstrom
We let our customers initiate new jobs in Switch from a public upload page, using a webhook in a Switch flow. The JSON-payload contains the Switch Portal User email adress (CSR).
Is it possible to map the job to a specific switch portal user (using email adress in metadata as a key)?
The reason why I would like to do this is to be able to use the option to filter by Current user, in Switch Portal. To let CSRs only see their own jobs.
Re: Job filters in Switch Portal (Filter by current user)
Posted: Fri Dec 02, 2022 4:42 pm
by Shawn_Anderson
We have a script that changes this from private data for the same reason you're asking, but you could also pull it from email or other metadata
Code: Select all
function jobArrived( s : Switch, job : Job )
{
var NewUser = job.getPrivateData("SubmittedBy")
var SubmitEmail = job.getPrivateData("SubmitEmail")
job.setUserName(NewUser);
job.setUserEmail(SubmitEmail);
job.sendToSingle( job.getPath() );
}
Re: Job filters in Switch Portal (Filter by current user)
Posted: Mon Dec 05, 2022 9:22 am
by magnussandstrom
Shawn_Anderson wrote: ↑Fri Dec 02, 2022 4:42 pm
We have a script that changes this from private data for the same reason you're asking, but you could also pull it from email or other metadata
Code: Select all
function jobArrived( s : Switch, job : Job )
{
var NewUser = job.getPrivateData("SubmittedBy")
var SubmitEmail = job.getPrivateData("SubmitEmail")
job.setUserName(NewUser);
job.setUserEmail(SubmitEmail);
job.sendToSingle( job.getPath() );
}
Thanks, I had a chat with Freddy and Jan and we ended up with the same solution.
Re: Job filters in Switch Portal (Filter by current user)
Posted: Thu Dec 08, 2022 9:36 pm
by magnussandstrom
There is an even easier way, you can just populate these PrivateData tags with the wanted user info:
EnfocusSwitch.userFullName
EnfocusSwitch.userEmail
EnfocusSwitch.userName
I ended upp using the Row2Variables app to map the user data, using the above mentioned tags as column names in a excel. Works like a charm!