Virtual Agent runs scripts as User

Aditya Raute
Mega Guru

When I'm running a script action in a VA topic, the script does not run as admin.

 

For instance, in one of my scripts I'm referring to the Date Of Birth (DOB) field of a user to conditionally show or hide a bot response for users older than 40. However, the DOB field is restricted via ACLs to everyone except admins (yes, you cannot even view your own DOB if you are not an admin). So the flow behaviour here is erratic as the Flow execution runs as the user who triggered it, not as an Administrator.

Ideally, if Flow Designer is allowed to run as User or as Administrator, VA topic flows should be allowed to do so, too

What can I do to fix this, or circumvent this issue? Bear in mind that I'm not displaying the DOB to the user anywhere - only using it to conditionally hide a bot response block.

7 REPLIES 7

Chris D
Kilo Sage
Kilo Sage

Are you getting an error? Any chance it's the script and not the ACL?

I've never run into issue running scripts from the VA - they always run with system/admin privileges and bypass ACLs.

Are you using GlideRecord or GlideRecordSecure? If you want to bypass ACLs, you have to use the former.

It simply says "I've run into techincal issues....". I'm using GlideRecord so that's not the issue. And the script is running for an admin, so I feel the script is correct too.

Anything in the log?

Definitely bizarre to hear that it runs (presumably in VA, right??) as an admin user but not as a non-admin user. I'm not sure what else could affect it then. Maybe it's like a data policy and data policies are enforced differently? I dunno...

No it's definitely ACL and not data policy because I've checked with other fields. 

Now I'm not very good at interpreting logs:

But here are the snapshots for that timeframe when I tried this again.

 

1) 

AdityaRaute_1-1671216376151.png

 

2) 

AdityaRaute_2-1671216410334.png

 

Anything you can spot that may serve as a clue?