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.
Job filters in Switch Portal (Filter by current user) [solved]
- magnussandstrom
- Advanced member
- Posts: 377
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Job filters in Switch Portal (Filter by current user) [solved]
Last edited by magnussandstrom on Thu Dec 08, 2022 9:40 pm, edited 4 times in total.
-
- Newbie
- Posts: 8
- Joined: Mon Apr 17, 2017 3:45 pm
Re: Job filters in Switch Portal (Filter by current user)
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() );
}
- magnussandstrom
- Advanced member
- Posts: 377
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Job filters in Switch Portal (Filter by current user)
Thanks, I had a chat with Freddy and Jan and we ended up with the same solution.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() ); }
- magnussandstrom
- Advanced member
- Posts: 377
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Job filters in Switch Portal (Filter by current user)
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!
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!