Jump to content
We've recently updated our Privacy Statement, available here. ×
  • How to fetch the logged in Username in Spotfire® using IronPython Script


    The following is an example IronPython script to fetch logged in Spotfire® Analyst user.

    Introduction

    The following is an example IronPython script to fetch logged in Spotfire® Analyst user.

     

    Note: From version 10.4, there is a new API - UserContext - that can be used to get user information. For an example of using that instead, please refer to the following article:

    https://community.spotfire.com/articles/spotfire/how-to-fetch-the-information-about-the-logged-in-user-in-spotfire-using-ironpython-script/

     

    Code sample

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    # Add a document property 'username' to display the username.
    
    from System import Environment, Threading 
    username = Threading.Thread.CurrentPrincipal.Identity.Name 
    Document.Properties["username"] = username
     

     

    License: TIBCO BSD-Style License

    Back to IronPython Scripting in Spotfire Examples


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...