Forum Discussion

Rajesh's avatar
Rajesh
Cloud Apps
06-21-2022

How to pass Sisense user id to the SQL Queries in Live Model

Hi -

We have a requirement to access Sisense User Id in the Live model SQL Queries. Do we have any way we can access the Sisense User Id/ Group via some variables?

2 Replies

Replies have been turned off for this discussion
  • cw_meg01's avatar
    cw_meg01
    Data Storage

    Try prism.user for information related to the user (id, group, etc.). The id is also available when the widget is ready (widget.userId). 

    widget.on('ready', function(widget){
    var userInfo1 = prism.user; // feel free to add the name of the attribute you are looking for once you identify it
    var userInfo2 = widget.userId;
    });

     

    • Rajesh's avatar
      Rajesh
      Cloud Apps

      Thanks for your response. It appears to be a Widget script, but I want to access these variables in the Model (SQL Query) any thoughts on this?