2

how can I get information from the logged in user and show it in a flexcard in omnistudio. in apex we can use the UserInfo class, but in omnistudio how do I do that in a dataraptor, integration procedure or flexcard?

2
  • Currently stuck on the same problem. Really hope someone in the community can provide suggestions on this one.
    – Jason Fung
    Commented Mar 16, 2023 at 1:39
  • I think I found a good working solution. Take a look at my answer and let me know what you think.
    – Jason Fung
    Commented Mar 16, 2023 at 4:16

1 Answer 1

3

There are a number of environment variables that we can use for DataRaptors and Integration Procedures according to this Salesforce doc: https://help.salesforce.com/s/articleView?id=sf.os_environment_variables_in_dataraptors_and_integration_procedures_47878.htm&type=5

For our use case, we can use the '$Vlocity.UserId' environment variable. Make sure you put single or double quote around it though when you use it. See screenshot below for how that works in a DataRaptor.

enter image description here

Update (March 18, 2023): I dug deeper into Saleforce docs and found a list of context variables, like {User.userId} that we can use to get the current user Id for flexcards. You can check out the list at: https://help.salesforce.com/s/articleView?id=sf.os_flexcards_context_variables.htm&type=5

1
  • That option '$Vlocity.UserId' worked! thank you very much! Commented Mar 23, 2023 at 15:01

You must log in to answer this question.

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