# Add custom properties

## Create custom properties

Custom properties can be added to standard objects (such as the Account object) and to custom objects like the Prescription object.

You can add a custom property from an object's detail view:

1. Select **Settings** > **Objects** on the left-hand menu.
2. Select the label of an object you'd like to view.
3. Scroll down to the Custom Properties pane and click **New Property**.
4. On the Create Property screen, you can fill out:
   * **Property Label:** Enter the label for your property that will be displayed in the UI.
   * **Property Name:** Enter the API name for your property.
   * **Property Type:** Select the type of property to create. For more information on property types, see primitive types in the API documentation.
   * **Property Access:** Select the access levels that users and roles have to this property.
5. Click **Create Property**. The Create Property screen is displayed.

![Create Patient Property](https://1068906237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mj66CGXHXfKBN06PGlf%2Fsync%2F1a0f1a21192aa274026ea3ebe1d7eb5a196bd4ab.png?generation=1631133259285465\&alt=media)

Since we're creating a Prescription object, we'll need to create a number of properties to represent a patient's prescription. The following table shows a few properties that we'll need to create:

| Label    | Name         | Type      | Description                       |
| -------- | ------------ | --------- | --------------------------------- |
| Date     | `c_date`     | Date      | Date of the prescription          |
| Dispense | `c_dispense` | Number    | Amount to dispense per refill     |
| Patient  | `c_patient`  | Reference | Reference to the patient account  |
| Provider | `c_provider` | Reference | Reference to the provider account |
| Refills  | `c_refills`  | Number    | Number of refills                 |
| Rx       | `c_rx`       | String    | Prescription details              |

### Create a Patient property

First, we'll create the Patient property.

1. On the Create Property screen, select **Reference** from the Property Type list. More options particular to the reference property type will be displayed.
2. For Source Object, select **Account**. We want to relate the prescription to the patient's account record.&#x20;
3. For Required Access, select **Connected**. This means that whoever is creating the prescription will need to have at least that level of access to the patient's account record.&#x20;
4. For Expandable, leave it as selected.&#x20;
5. For Grant Access, select **Read**.
6. Check **Indexed**. This will allow us to query prescriptions by `patient account \_id`.
7. Click **Create Property** once the property has been configured.

After creating the Patient property, you will see it listed under Custom Properties of the object's detail view.

![Reference Property](https://1068906237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mj66CGXHXfKBN06PGlf%2Fsync%2F78b97ea48425f0430aa33e072d4d762ad3033aa2.png?generation=1631133260110334\&alt=media)

### Create a Date property

Next, we'll create the Date property.

1. On the Create Property screen, select **Date** as the property type.&#x20;
2. Check **Date Only**, as this does not need to be a date-time property.&#x20;
3. Check **Indexed** so that we can query prescriptions by date.
4. Click **Create Property** once the date property has been configured.

![](https://1068906237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mj66CGXHXfKBN06PGlf%2Fsync%2Fb84fe2d65fa57ca54afd7c7227de20da7e61faa6.png?generation=1631133259540525\&alt=media)

### Create an Rx property

Next, we'll create the Rx property. This time we will:

1. On the Create Property screen, select **String** as the property type.&#x20;
2. Check **Indexed**.
3. Enter a value in the Max Length field that is appropriate.
4. Click **Create Property** once the property has been configured.

![](https://1068906237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mj66CGXHXfKBN06PGlf%2Fsync%2F9c52f321a99d4bf60459422a15c99efdb6637462.png?generation=1631133259858349\&alt=media)

### Create additional properties

Finally, create a few more properties to complete the object.

![](https://1068906237-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mj66CGXHXfKBN06PGlf%2Fsync%2F51e4a21de4668073ecbbcddffb6a7ec2ea49d806.png?generation=1631133259700976\&alt=media)
