Access User Name/Email from Variable/Table record

Hi!

I have a connector that send info from a table to an outside instance.

I cannot send a Tulip user through the API but I would like to send their email.
However, when accessing the user from the table, there is no way to extract the user name, email, etc. This should be implemented.

Note! The user I get from the table is not the same as the logged-in user

Hi there!

If you add the Users Table to your app, you should be able to access the properties present in Settings → Users → Custom Fields, from your Connector function (so long as it is the right data type).
Adding Users Table in-app

% In trigger
Run Connector Function -> Connector -> field: Table Record -> Users Table -> Email

You can go about loading into the user record in a variety of ways (interactive table, single select dropdown, etc.).

Unfortunately, to access the user name you’ll need to use a workaround. You can view some of those here: Extract User Name Text from User Table

Hi Preston!

I appreciate the quick response.
Your idea was good. My thought was that by loading the user into the user table record I could extract both email and name. However, our custom user table is not populated with emails or names. I tried making a looper to populate it but the only way I could figure out was by using an aggregation and the user table does not have those (Atleast I cannot find it).

Do you have any tips?

This raises a few key points/requests:

  1. Import/update the Users table from a .csv file.
  2. Auto update the Users table with information stored in each User profile (email, badge ID, name, role). I imagine this could also be a “locked” field, similar to how you cannot change the IDs in regular tables.
  3. Queries and aggregations for Users table. Using the Table widget, you can implement filters and sorts, so some of that functionality exists already.

At present, I can access a User’s profile info (name, email, etc.) by hardcoding the User profile into a trigger (see snippet below), but can’t dynamically load into another User’s profile info. This would be solved by request 2.

Data Manipulation -> Store -> Users -> Preston Fisher -> Name -> Table Record -> Users Table -> dupeName

The current workaround seems to be duplicating all user info into another regular table. This requires maintenance, and is less than ideal.

As for populating your emails/names, etc. in Custom Fields, I can think of a few methods.

Method 1
Manually enter details in Settings → Users → Custom Fields. If you have a small number of users, then this is the way to go.

Method 2

  1. Export .csv of Users from Settings → Users (top right, next to blue Add User button).
  2. Within app, import required values and split into an array.

You can’t easily loop the Users table, as the ID is a User value. You could probably mess around and create a User list, but I imagine the following is easier:

  1. Use the Interactive Table widget, link to Record Placeholder of Users tables. Apply filter for Users that do not have email fields, etc.. Note that you can’t sort by name, because it’s not yet in the Users table.
  2. Create a button trigger that stores arrayVar.0 in loaded user, then remove those values from array. For visibility it’ll likely be useful to display these arrays on-screen.
  3. Click desired User in Interactive Table. Click button. Repeat.

Method 3
Ditch Users table entirely, and import .csv of Users table into new regular Tulip table. Think carefully about which property you want to use for your ID.

Dang, these are super creative @Preston! Love it. Agreed that there is no good solution to this currently, but we are discussing simple ways to make this easier. I think the easiest one would be to just expose the user’s email address in Triggers… it would require some planning on the part of the app builder and table builder, but it would be a simple way to make this possible.

3 Likes

Thank you for all your creative solutions!
I will try them out :slight_smile:

1 Like

Hi @saga.losman, as part of the launch for Ops Calling 2024, we did indeed launch a Users API with GET and LIST endpoints. It comes with r289 and later. For an example of the docs, see our API docs here: /api/users/v1/users - users

If you enjoy this, or have other endpoints you are looking for, let us know in the comments here!