User
Share
Explore

icon picker
User

Jahangir Ahmed
Formula: User()
Category: People
gender-neutral-user (1).svg
User()
Returns the user that is currently logged in the doc so it’ll always be automatically your own user
or stated otherwise...
Hey Coda, will you please output my name/profile record?

User() does not take any parameters.

There are many ways to experience the power of Coda’s doc being as powerful as an app, such as buttons, automations, in-line formulas and much more! With User(), you’re about to discover how to turn your doc from static for everyone to a complete chameleon that changes and adapts according to who is using it. That is one of the hidden powers of the User() formula.
Most people know the User() formula gives you some properties for the current user, but for a real Coda expert that’s just the beginning. By combining this formula with canvas formulas and filters in tables, you’ll be able to unlock the real potential of this seemingly-simple feature. Let’s get to it!

The Basic Outputs of the User() Formula

As you read in the first section of this page, the User() formula will return the user record of the person who is currently using the doc, which is unique for each user. Let’s run this formula to see the result:

User() =
@Anonymous User

As you can see, your own name appeared here as if by magic! But did you notice it has an @ symbol ahead of it and it appears blue, as if it was a hyperlink? That is because the User() formula returns the current Coda user in the “People” format that you can use in any table.
CleanShot 2022-12-10 at 16.59.57@2x.png
This format packs together multiple attributes or details related to the user it mentions.
If you hover on it, you’ll see a pop-up that contains more information about the user such as name, email and profile pic.
These are all properties you can reference with the User() formula. Let’s dive into the details for each one of these properties:
Name

User().Name =
Anonymous User
Displays the user name without the @ symbol and in a text format.
Useful for dynamic reports and text filters.
filled-message.svg
Email
User().Email =
[ ]
Returns the email address of the Coda user.
Could be used to send emails to current user.
[ ]
Photo

User().Photo
Automatically shows the profile picture of the current user.
Useful for dashboards and welcome pages.
restriction-shield.svg
User access

User().State =
NowMissing
Shows the type of permissions of the user in the doc.
Could be user for informational prompts.

Let’s Explore Some Use Cases!

Now that you’re familiar with the type of information you can get by using the User() formula let’s see potential use cases!

Use the name of the current user for a dynamic title

Let’s say you want to include the name of the current user inside a text line or the title of a homepage. By combining Coda’s canvas formulas and User() you can achieve this easily.
The only thing you need to do is creating a new canvas formula by typing = inline with your text and then referring to the Name property of the User() formula.

Welcome back
Anonymous User
!

This is how the simple canvas formula would look like
image.png
Remember that you must add the .Name attribute. Otherwise you'd get the hyperlink with the @ symbol ahead of the user name

Create tasks for the current user

Let’s say you’ve built a task manager in your Coda doc and you want to assign each new task to the current user. You could accomplish this by using the CreatedBy() formula as we’ve covered in the section. But another option is the use the User() formula.
Let’s explore two ways of achieving this with the same formula:

New task with a button

If you like to use buttons in your doc, you could automate the task assignment easily by using the User() as the content of the “Responsible” column in this example. Click the yellow button below and you’ll see that each new task is automatically created with you as the responsible person.
List of tasks:
Create New Task
1
2
3
4
Task
Responsible
Test task 1
Steven Hurtado
Test task 2
Scott Weir
Test task 3
Stuart Weir
Test task 4
Nina Kastenauer
There are no rows in this table

This is how you’d set up the button action:
CleanShot 2022-12-10 at 18.45.18@2x.png

New task by adding a row to the table

If you don’t lean towards using a button to create a new row, there’s another way you can harness the power of User() too. In this case, we’ll setup a similar table and in the Responsible column we’ll add User() as the Value for new rows.
Click in the “+ New row” button at the bottom of the table below to add a new row in the table and you’ll see your own user as Responsible for the newly created task.
List of tasks:
1
2
3
4
Task
Responsible
Test task 1
Steven Hurtado
Test task 2
Scott Weir
Test task 3
Stuart Weir
Test task 4
Nina Kastenauer
There are no rows in this table


This is how you’d set up the button action:
CleanShot 2022-12-10 at 18.50.37@2x.png

Filter a table based on the current user

Let’s say you have a big table with all the tasks in your company and you want to show each user only their own tasks without the need to manually apply a filter to the table. This is a such perfect use case for User() that Coda natively suggests you the Current User as a default filter option whenever you select a People column.
Anonymous these are your tasks:
Task
Responsible
There are no rows in this table

Reminder: if you see no tasks in the table, remember to create new tasks assigned to you in the previous steps.
This is how your filter setup would look like:
CleanShot 2022-12-10 at 19.16.45@2x.png
Done
Build your Task Manager dynamic homepage
Done
Create custom nicknames for individuals in your doc
Done


Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.