---
title: "Search functions"
canonical: "https://support.appfire.com/space/AIP/10256824/Search%20functions"
format: markdown
---
> Macro (aura-html)

The Asset Navigator search functions provide tools for filtering assets based on their relationships with other assets. This documentation introduces two key functions: `referenceAsset` and `referenceAssetByType`. 

These functions allow you to target assets based on the values of their referenced assets, enabling you to perform complex and specific searches within the Asset Navigator.

## referenceAsset

> ℹ️ This feature is introduced at AIP v7.0.1.

*referenceAsset* function lets you filter assets by referenced assets value. For example, there is a Computer asset that has a Mouse reference asset. You can filter all Computers that have a Mouse and are assigned to a user such as current, reporter, assignee, or a specific user.

You can use this function at Basic Search of Asset Navigator for "Asset List" or "Asset List by Asset Type" type of attributes.

<span style="color: #172b4d">Field names are case-sensitive.</span>

| <span style="color: #42526e">**Syntax**</span> | referenceAsset("FIELD NAME 1", "VALUE 1", "FIELD NAME 2", "VALUE 2", ..) |
| --- | --- |
| **Supported fields** | "Asset List", "Asset List by Asset Type" |
| **Description** | Field name and value pairs are expected. Number of parameters should be an even number. |

**Examples:**

| **Field name to query** | **Description** | **Examples** |
| --- | --- | --- |
| **Text-Based System Fields:**<br>- Asset Tag = asset.assetTag
- owner = asset.owner
- Serial Number = asset.serialNumber
- Invoice Number = asset.invoiceNumber<br>**Text-Based Attributes** (User defined fields):<br>- Text
- Text Area
- IP
- IPv6
- URL<br>Use exact field name for attributes. Field names are case sensitive | Query with free text.<br>If the text has any double quotes, they must be escaped. For example: "My \"text\" here"<br>Wildcard search is supported, see: [Wildcard search](https://appfire.atlassian.net/wiki/spaces/AIP/pages/10257291) for more details. | Query exact match (surrounded with double quotes) with one text based system field Asset Tag:  
    referenceAsset("asset.assetTag", "\"marla singer\"")<br>With Serial Number:  
    referenceAsset("asset.serialNumber", "\"my serial\"")<br>Query with 3 different type of field values at a time. First Name is a Text field, Jira User is a Jira Single User Select field and Cities is a checkbox field:  
    referenceAsset("First Name", "marla", "Jira User", "tyler", "Citites","Ada")<br>Query for surname that have starts with `te`. This applies for all text-based fields.  
    referenceAsset("Surname", "te*")<br>Query for a url with exact match:  
    referenceAsset("URL", "\"[https://appfire.com/\](#)"") |
| **User based System Fields:**<br>- assigne = asset.assignee
- owner = asset.owner
- managed by = asset.managedBy
- reserved for = asset.ReservedFor<br>**User based Attributes** (User defined fields):<br>- Jira Single User Select
- Jira Multiple Users Select<br>Use exact field name for attributes. Field names are case sensitive | Query with user name or user key.<br>**Variables:**<br>Following variables are available:<br>- **$currentUser**: Current logged-in user
- **$reporter**: Issue's reporter or current logged-in user when reporter not found. $reporter is the value of issue reporter field at issue edit/create screens (not linked asset-issues reporter.)
- **$assignee**: Issue's assignee. Empty evaluated if not found. $assignee is the value of issue assignee field at issue edit/create screens (not linked asset-issues assignee.)
- **$assigneeOrCurrent**: Issue's assignee or current logged-in user when assignee not found.  $assignee is the value of issue assignee field at issue edit/create screens (not linked asset-issues assignee.) | Query with user key:<br>referenceAsset("asset.assignee", "JIRAUSER18101")<br>Query with user name:<br>referenceAsset("asset.owner", "tyler")<br>Query "Jira Users" field contains user "marla" and city is Ada.<br>referenceAsset("Jira Users", "marla", "City", "Ada") |
| **User Picker based Attributes** (User defined fields)<br>- Jira User Picker (Free text input is enabled)<br>Use exact field name for attributes. Field names are case sensitive | This field stores user name (other user fields holds Jira user key). Additionally enables display name search.<br>Searching with function variables:<br>- **$currentUser**: Currently logged-in user's name
- **$currentUser.displayName:**  Currently logged-in user's display name
- **$currentUser.email: ** Currently logged-in user's email<br>**$repoter **and **$assignee **works just like **$currentUser, **except if **$reporter** is not found, currently logged in user is used.<br>- **$repoter**
- **$repoter.displayName**
- **$repoter.email**
- **$assignee**
- **$assignee.displayName**
- **$assignee.email** | Exact user name search:<br>referenceAsset("Jira User Picker", "\"agrant-sd-demo\"")<br>Display name having a word starts with ala (*wildcard text search*):<br>referenceAsset("Jira User Picker", "ala*")<br>Display name is exactly equals to "Alana Grant"<br>referenceAsset("Jira User Picker", "\"Alana Grant\"")<br>E-mail address is exactly equals to "agrant-sd-demo@example.com"<br>referenceAsset("Jira User Picker", "\"agrant-sd-demo@example.com\"")<br>Search with currently logged in user.<br>referenceAsset("Jira User Picker", "$currentUser")<br>referenceAsset("Jira User Picker", "\"$reporter.email\"") |
| **List based System Fields:**<br>- Belongs To Group = asset.belongsToGroup
- Location = asset.location
- Cost Currency = asset.costCurrency
- Status = asset.status
- Substatus = asset.substatus<br>**List based Attributes **(User defined fields):<br>- Dropdown List
- List Box
- List Box - Multiple
- Radio Button
- Checkbox<br>Use exact field name for attributes. Field names are case sensitive | Put 3 @ chars between keywords like "Ada@@@Sel" | Query Cities having İstanbul:<br>referenceAsset("Cities", "İstanbul")<br>Query Cities having Lima or İstanbul:<br>referenceAsset("Cities", "Lima@@@İstanbul")<br>Query Belongs to Group system field having managers:<br>referenceAsset("asset.belongsToGroup", "managers")<br>Query Belongs to Group system field having managers or jira-developers:<br>referenceAsset("asset.belongsToGroup", "managers@@@jira-developers")<br>Query "Status" system field is "In Stock" and "Substatus" system field is "Defective". These values must be English value of the field:<br>referenceAsset("asset.status", "In stock", "asset.substatus", "Defective") |
| **Numeric System Fields:**<br>- Cost = asset.cost<br>**Numeric Attributes **(User defined fields):<br>- Number Float (with decimals)
- Number Long (without decimals)<br>Use exact field name for attributes. Field names are case sensitive | Use dot "." as decimal separator. | **Exact search:**<br>referenceAsset("Item Price", "120.45")<br>referenceAsset("Item Age", "21")<br>**Range search:**<br>Between 120 and 139 *(120 and 139 are included)*<br>referenceAsset("Number Float", "120@@@139")<br>Less than 139 or equal to 139<br>referenceAsset("Number Float", "@@@139")<br>Bigger than 110 or equal to 110<br>referenceAsset("Number Float", "110@@@")<br>System field Cost (between 10 and 120) and currency (EUR) search.<br>referenceAsset("asset.cost", "10@@@120", "asset.costCurrency", "EUR") |
| **Date and Date-Time System Fields:**<br>- Asset create date time = asset.created
- Asset update date time = asset.updated
- Install date = asset.installDate<br>**Date and Date-Time Attributes **(User defined fields):<br>- Date Picker
- Date Time Picker<br>Use exact field name for attributes. Field names are case sensitive | Field value must be in ISO date and date-time format:<br>- **Date format**: YYYY-MM-DD , Example: 2020-12-25<br>- **Date time format**: YYYY-MM-DDTHH:mm  , Example: 2020-06-02T15:45 | **Exact search:**<br>referenceAsset("asset.installDate", "2020-06-01")<br>**Range search:**<br>referenceAsset("asset.installDate", "2020-05-01@@@2020-06-02")<br>referenceAsset("asset.installDate", "@@@2020-06-02")<br>referenceAsset("asset.installDate", "2020-05-01@@@") |
| **"Asset List" and "Asset List by Asset Types" Attributes**<br>Use exact field name for attributes. Field names are case sensitive | Put hashtag before asset Id for reference asset search.<br>*referenceAsset* of *referenceAsset* script search is not ready yet. | **Single value search:**<br>referenceAsset("Child Asset", "#644")<br>**Multiple value search:**<br>referenceAsset("Child Asset", "#642@@@#644") |

## referenceAssetByType

> ℹ️ This feature is introduced at AIP v7.0.4.

*referenceAssetByType *works just like referenceAsset with one more additional parameter, which lets you filter assets by asset type.

referenceAssetByType("ASSET TYPE NAME", "FIELD NAME 1", "VALUE 1", "FIELD NAME 2", "VALUE 2")

|  |  |
| --- | --- |
| **Function signature** | referenceAssetByType("ASSET TYPE NAME 1", "FIELD NAME 1", "VALUE 1", "FIELD NAME 2", "VALUE 2", ...) |
| **Description** | Asset type, field name and value parameters are expected. Number of parameters should be 3, 5, or 7. |

**Example:  **referenceAssetByType("Mouse", "Model", "pandas", "Vendor", "apple")

## Screenshots of usage

Personal Computer has Mouse Inventory and assets are filtered by reference assets having asset type=Mouse, model=pandas, vendor=apple.

Final search script is: referenceAssetByType("Mouse", "Model", "pandas", "Vendor", "apple")