×
We value your feedback! Please click here to access our 2024 Client Survey.
The survey will remain open until November 1st. Your perspective will help guide our product/service planning and goals for the upcoming year and beyond!

Export user "name" vs "id" in Created By and Modified By column

LabKey Support Forum
Export user "name" vs "id" in Created By and Modified By column bhaddock  2024-04-22 09:40
Status: Active
 

Hi LabKey,

I have a list that contains columns "Created By" and "Modified By", and I am trying to figure out how to access more of the data stored in those columns via your python API.

  • On the website, those columns contain a user's Display Name as a clickable link, which goes to a little summary page of the user.
  • When I use the "Export" button online to export the sheet to an excel workbook, the Created By and Modified By columns contain just the display names of users (no link or other data). I'm attaching a screenshot of the export button I'm referring to.
  • When I use the code below to access the data via your python API, those columns are labelled "CreatedBy" and "ModifiedBy", and contain user ids.
my_results = api.query.select_rows(
    schema_name='lists',
    query_name='HVTN SDMC Lab/Assay Data Status Tracker',
    view_name='Full Export'
)

Is there a way to use access the Display Names associated with those user ids via the python API?

Thanks so much!

Beatrix

 
 
Steve responded:  2024-04-22 12:59

Hi Beatrix:

If you specify the columns to return, you can get the DisplayName as follows:

my_results = api.query.select_rows(
    schema_name='issues',
    query_name='Issues',
    columns='IssueId, CreatedBy/DisplayName'
)