Job filters in Switch Portal (Filter by current user) [solved]

Post Reply
User avatar
magnussandstrom
Advanced member
Posts: 345
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Job filters in Switch Portal (Filter by current user) [solved]

Post 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.
Last edited by magnussandstrom on Thu Dec 08, 2022 9:40 pm, edited 4 times in total.
Shawn_Anderson
Newbie
Posts: 8
Joined: Mon Apr 17, 2017 3:45 pm

Re: Job filters in Switch Portal (Filter by current user)

Post 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() );

}
User avatar
magnussandstrom
Advanced member
Posts: 345
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Job filters in Switch Portal (Filter by current user)

Post 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.
User avatar
magnussandstrom
Advanced member
Posts: 345
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Job filters in Switch Portal (Filter by current user)

Post 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!
Post Reply