> For the complete documentation index, see [llms.txt](https://docs.extrahorizon.com/extrahorizon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.extrahorizon.com/extrahorizon/services/manage-data/data-service/faq-data-service.md).

# FAQ Data Service

## Schema Design

### How can I validate that an array does not contain a certain value in a transition condition?

If it is an array of strings, you can use regex expressions. In the following schema definition, you can find an example of a validation where the tag `important_tag` should not be present.

The relevant regex expression is `^(?!important_tag$).+$`

```json
{
    "name": "measurementSchema",
    "description": "Example Measurement Schema",
    "statuses": {
      "active": {}, 
      "deleted": {}
    },
    "creationTransition": {
      "type": "manual",
      "toStatus": "active"
    },
    "transitions": [
        {
            "name": "startRemoval",
            "type": "manual",
            "fromStatuses": [
                "active"
            ],
            "toStatus": "deleted",
            "conditions": [
                {
                    "type": "input",
                    "configuration": {
                        "type": "object",
                        "properties": {
                            "tags": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "pattern": "^(?!important_tag$).+$"
                                }
                            }
                        }
                    }
                }
            ]
        }
    ],
    "properties": {
        "tags": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    }
}
```

### How can I validate that an array does contain a certain value in a transition condition?

To validate that an array does contain a certain value there are different options. The following examples show how to check if an array contains the value `important_tag`.

Each code snippet shows the code in the condition configuration part of the schema.

#### Option 1 • Use a regex

```json
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "contains": {
    "type": "string",
    "pattern": "^important_tag$"
  }
```

#### Option 2 • Use the const keyword

```json
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "contains": {
    "type": "string",
    "const": "important_tag"
  }
}
```

#### Option 3 • Use the enum keyword

```json
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "contains": {
    "type": "string",
    "enum": ["important_tag"]
  }
}
```

## Data Manipulation

### How can I remove values from an array property in a record?

If the array items are objects, you can remove an object by executing the following HTTP call:

```
DELETE /data/v1/{{schemaIdOrName}}/documents/${documentId}/{{arrayName}}/{{objectId}}
```

If the array items are simple values, like strings or numbers, you have to execute a `PUT` to the record endpoint and provide the full array (leaving out the value that you want to remove).

## Permissions

### What is the difference between creatorId and userIds in a document?

The `creatorId` refers to the user that created the document, `userIds` is an array of users which have access to the document as set by the [document permissions](https://docs.extrahorizon.com/extrahorizon/services/manage-data/data-service/schemas#access-modes). A simple use case is for example if you want to share a single document with multiple individual users which are not necessarily in the same group.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.extrahorizon.com/extrahorizon/services/manage-data/data-service/faq-data-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
