Add transactions by user related list

task brazil Updated Sep 10, 2026 1 min read t_ExampleTransactionsByUser.md
Raw file servicenow.com

This example adds a relationship, Last 20 transactions, to the user form.

Before you begin

Role required: admin

About this task

The new relationship creates a list of task records opened by the current user.

Procedure

  1. Navigate to All > System Definition > Relationships.

  2. Click New.

  3. Create a relationship with the following values.

Name

Last 20 transactions

Applies to table

User [sys_user]

Queries from table

Task [task]

Queries with

JavaScript
current.addQuery('opened_by', parent.sys_id);
4. Click **Submit**.
  1. Navigate to User Administration > Users.

  2. Select any user.

    For example, select David Loo.

  3. Configure the related lists for the user form and add the related list Last 20 transactions.

  4. Navigate to User Administration > Users.

  5. Select any user.

    For example, select David Loo.

  6. The Last 20 transactions related list displays all task records opened by the current user.

What to do next

Notes and limitations:

  • This query returns all task records opened by the user. The related list defaults to displaying 20 task records per page.
  • The parent variable refers to the Applies to table. In this case, it applies to the User [sys_user] table.
  • Querying against a record sys_id is a common query method for relationships.

Parent Topic:Create defined related lists

Related topics

Add a related list to a form

Search documentation
Search document titles and file paths on the brazil branch