---
title: "FProperties"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/4350672933/FProperties"
format: markdown
---
![image](media://2f1715d9-0bd8-4c56-9dd1-78f1ce10fdba)

**FProperties** component is a component that show fields in a column, one by one

Basically each element of it is referring to certain entity (table, for example Account, or Work Order or Installed Product), while each object inside is a field of that table (for example, `Name` of the account, or `FIELDBUDDY__Closure_Status__c` of the work order)

It is quite common and used in the following places

- [WorkOrderDetails](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5259100161) screen (`propertiesLayout`)
- Add/Edit Time registration screen
- WorkOrderClosure screen
- AdvancedChecklist (details as checklist) screen for Work Order Line Items
- Installed Product details screen (MultiItems, first tab)






<details>
<summary>Sample FProperties</summary>

```json
"config": {
    "sections": [
        {
            "iconName": "md-people",
            "iosIconName": "ios-people",
            "mapping": "Account",
            "title": "${Account.label}",
            "objects": [
                {
                    "name": "Name"
                }
            ],
            "table": "Account"
        },
        {
            "table": "Contact",
            "iconName": "md-person",
            "iosIconName": "ios-person",
            "title": "${Contact.label}",
            "mapping": "Contact",
            "objects": [
                {
                    "name": "Name"
                },
            ]
        },
        {
            "condition": [
                {
                    "executor": "jsonQuery",
                    "type": "filter",
                    "source": "${DATA}",
                    "formula": "FIELDBUDDY__Work_Order__c[Id=${CURRENT_WORK_ORDER}]:isServiceRequestBased"
                }
            ],
            "iconName": "md-cog",
            "iosIconName": "ios-cog",
            "mapping": "FIELDBUDDY__Installed_Product__c",
            "objects": [
                {
                    "name": "Name",
                    "readonly": true
                },
                {
                    "name": "FIELDBUDDY__Installed_Product_Number__c",
                    "barcodeEnabled": true
                }
            ],
            "table": "FIELDBUDDY__Installed_Product__c",
            "title": "${FIELDBUDDY__Installed_Product__c.label}"
        },
        {
            "condition": [
                {
                    "executor": "jsonQuery",
                    "type": "filter",
                    "source": "${DATA}",
                    "formula": "FIELDBUDDY__Work_Order__c[Id=${CURRENT_WORK_ORDER}]:isServiceRequestBased"
                }
            ],
            "headless": true,
            "mapping": "FIELDBUDDY__Product__c",
            "objects": [
                {
                    "name": "Name"
                },
                {
                    "name": "FIELDBUDDY__Product_Type__c"
                }
            ],
            "table": "FIELDBUDDY__Product__c",
        }
    ]
},
"type": "FProperties"
```
</details>


Below are the sample structure of the FProperties

| **Property** | **Description** | **Value** | **Default** |
| --- | --- | --- | --- |
| **sections** | Array of elements with structure described below | ```
{
    "iconName": "md-people",
    "iosIconName": "ios-people",
    "mapping": "Account",
    "title": "${Account.label}",
    "objects": [
        {
            "name": "Name"
        }
    ],
    "table": "Account"
},
``` | [] |


Each element should contain following properties

| **Property** | **Description** | **Value** | **Default** |
| --- | --- | --- | --- |
| **iconName** | icon name for Android devices<br>more about icons here - [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5249826918](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5249826918) | ```
"iconName": "md-people"
``` | empty |
| **iosIconName** | icon name for iOS devices<br>more about icons here - [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5249826918](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5249826918) | ```
"iosIconName": "ios-people"
``` | empty |
| **mapping** | Describe entity name, for which information is shown. Should be same as “table” property | ```
"mapping": "Account",
``` | empty |
| **title** | Label of the header.  
Standard, Custom labels or hardcoded text can be used | ```
 "title": "${Account.label}",
``` | empty |
| **objects** | array of fields from the table to be shown | array of elements, described below | [] |
| **table** | Describe entity name, for which fields are shown. Same as sObject name in salesforce | ```
"table": "Account"
``` | empty |
| **definedPath** | Allows to specify a custom path defined in `defaultPaths` - [https://help.fieldbuddy.com/space/FBDOCS/5671190536/rules](https://help.fieldbuddy.com/space/FBDOCS/5671190536/rules) | ```
"definedPath": "FIELDBUDDY__Sub_location__c"
``` | empty |
| **headless** | Boolean, if  false – title (and header row respectively) is not shown | ```
 "headless": true
``` | `false` |
| **condition** | Support conditional rendering of each respective section | array of conditions from [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5250023575](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5250023575) | [] |

**objects** properties  
Each element of Object property represents a field on respective entity in salesforce that is being shown

> ⚠️ URL type fields are not supported yet

> ⚠️ `format` works only for read-only fields. If it is configured for non-read-only field, changes of that field will not be properly saved

<details>
<summary>Example object config</summary>

```
{
    "name": "Name",
    "readonly": true,
    "label": "${FIELDBUDDY__Service_Agreement__c.label}"
}
```
</details>

| **Property** | **Description** | **Value** | **Default** |
| --- | --- | --- | --- |
| **name** | API field name of an object | "name": "Name", | empty |
| **label** | Allows to override label of a field<br>> ❌ A label works only for virtual fields. All other fields use the label defined in their metadata. | ```
"label": "my special field"
``` | Label of a field |
| **readonly** | Allows to enforce field to be always read only | ```
"readonly": true
``` | false |
| **format** | Allows to specify format of the field.<br>> ❌ this feature works only for read-only fields. If it is configured for non-read-only field, changes of that field will not be properly saved, so do NOT change it<br>Supported for date or date/time fields for read-only format | ```
"format": "DD-MM-YYYY"
``` | empty |
| **barcodeEnabled** | Allows to show Barcode scanner<br>Only the following types are supported:<br>`["STRING", "TEXTAREA", "TEXT", "DOUBLE", "CURRENCY"]` | ```
"barcodeEnabled": true,
``` | false (unless in rules set to true) |
| **virtual** | Allows to create formulas, which will be read only, and not saved to Service Center | ```
"virtual":true
``` | false |
| **persistentFormula** | determines if value of the field is a formula. If checked, **readonly** must be true as well | ```
 "persistentFormula": true,
``` | false |
| **formula** | JS formula that will evaluate to the value of field | ```
"formula": "f=()=>{try{let e= new Date('${E}'.split(' ').join('T')); e.setSeconds(0,0);let s= new Date('${S}'.split(' ').join('T')); s.setSeconds(0,0);let minutes= (new Date(e.toUTCString()).valueOf()-new Date(s.toUTCString()).valueOf());  minutes = minutes/1000/60; if(minutes <=0){return '-';}   var h = Math.floor(minutes / 60);var m = minutes % 60; return h + ' h '+ m + ' min'; } catch(ex){return '-'}};f();"
``` | empty |
| **params** | Information that can be used in formula | ```
{
    "virtual": true,
    "name": "Duration__c",
    "label": "Duration",
    "params": [
        {
            "var": "${S}",
            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
            "field": "FIELDBUDDY__Start_Time__c"
        },
        {
            "var": "${E}",
            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
            "field": "FIELDBUDDY__End_Time__c"
        }
    ],
    "formula": "f=()=>{try{let e= new Date('${E}'.split(' ').join('T')); e.setSeconds(0,0);let s= new Date('${S}'.split(' ').join('T')); s.setSeconds(0,0);let minutes= (new Date(e.toUTCString()).valueOf()-new Date(s.toUTCString()).valueOf());  minutes = minutes/1000/60; if(minutes <=0){return '-';}   var h = Math.floor(minutes / 60);var m = minutes % 60; return h + ' h '+ m + ' min'; } catch(ex){return '-'}};f();"
}
``` | empty |
| **hiddenFormula** | object, determines if field should be shown/hidden | ```
"hiddenFormula": {
    "params": [
        {
            "var": "${T}",
            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
          "field": "FIELDBUDDY__Type__c"
        }
    ],
    "formula": "f=()=>{return Boolean('${T}' === 'Reizen'); };Boolean(f());"
},
``` | empty |
| **default** | describes default value of the field for newly created records (like Work Order Line Items or Timesheet line items | ```
{
    "name": "My_WOLI_Field__c",
    "default": {
        "params": [],
        "formula": "f=()=>{try{let d1= new Date(); return d1.toISOString(); } catch(ex){}};f();"
    }
}
``` | empty |


Example of field usage 

Virtual Formula to show travel distance in KM  – duration  


Persistent formula that is saved to the Service Center