Vlocity Facts #30 || Environment Variables in DataRaptors and Integration Procedures

To define Default Values and Filter Values, and in Formulas we can use environment variables.

Interview question with example.

1. How to pass current user id to DataRaptor or Integration Procedure?
We can get userId from omniscript and we can pass it to DataRaptors and Integration Procedures or we can get userId by using Environment variables.

Omniscript
       We can pass userId by using merge syntax %userId% to DataRaptor or Integration Procedures.

Environment Variable
          We can pass '$Vlocity.UserId' to get the user details 

2. How to filter dates in DataRaptor using literal dates?
                          By using environment variables we can filter the dates.
                                Example: $Vlocity.N_DAYS_AGO:30Note: If you’re using an environment variable as a Filter value, you must double-quote it.

3. How to get current user details in flexcards?
        To get the current user details we can use context variables in flexcard
                {User.property}
                 For example, {User.userName} gets the logged in user's username. 

For Reference: Environment variables, Context variables Flexcards


Comments

Popular posts from this blog

Vlocity Facts #01 | OmniStudio DataRaptors

Vlocity Facts #34 || Getting the details from the URL in a FlexCard and an Omniscript

Vlocity Facts #44 || Communication between Omniscript and Flexcard [Pub/Sub]