2

I have created an Omniscript who's components rely heavily on the current user's id. I am using the environment variable userId. An example of this is use is that I pass userId to a Dataraptor that returns the Contact information for that specific user Id.

I am able to test the different users by signing in as different users and opening up a page where the Omniscript is embedded. However, I would like to test different users in the Preview tab. Is there a way for me to override userId purely when I test the Omniscript?

2 Answers 2

3

I've discovered the answer using the ContextId and the always handy Set Values!

I simply set a json key value pair using a the custom formula IF(EQUALS(%ContextId%, NULL), %userId%, %ContextId%)

Then I pass the activeUserId instead of the userId.

So much better for testing other users.

Screenshot of Set Values element, with a formula that uses either the ContextId or the userId

0

You can also try using a setValues to set the user Id or profile in the beginning of the OS to "force" it to use that user(haven't tested it with a user specifically, but worth the shot).

enter image description here

2
  • 1
    This is something I would encourage you to try first before including in an answer. When you're giving a solution, the burden to show that it works is generally on the person providing the solution.
    – Derek F
    Commented Oct 17, 2023 at 21:52
  • Thanks for the tip, I'm not kinda new here but for answers, I am. Commented Oct 18, 2023 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .