---
# System prepended metadata

title: FormBuilder Events

---

# FormBuilder Events

```csharp
// Common Interfaces
interface IStateTracker<TCurrent, TPrevious>
{
    TCurrent Current { get; }
    TPrevious Previous { get; }
}
interface IEventData<TRequest, TCurrent, TPrevious>
{
    EventType Type { get; }
    TRequest Request { get; }
    IStateTracker<TCurrent, TPrevious> State { get; }
}
```

## AddControl

> Note:
> request and final order might be different

```json
{
    "type": "AddControl",
    "request": {
        "controlId": "Guid",
        "controlType": "Page",
        "parentId": "Guid or null",
        "order": "1"
    },
    "State": {
        "current": {
            "order": "2" 
        },
        "previous": {}   
    }
}
```

## MoveControl

> Note:
> request and final order might be different

```json
{
    "type": "MoveControl",
    "request": {
        "controlId": "Guid",
        "parentId": "Guid or null",
        "order": "1"
    },
    "State": {
        "current": {
            "parentId": "Guid or null",
            "order": "2" 
        },
        "previous": {
            "parentId": "Guid or null",
            "order": "5" 
        }   
    }
}
```

## RemoveControl

> Note:
> `deletedIds` list must include request `controlId`

```json
{
    "type": "RemoveControl",
    "request": {
        "controlId": "Guid",
    },
    "State": {
        "current": {
            "deletedIds": [
                "Guid: Control[1].Id",
                "Guid: Control[2].Id",
                "Guid: Control[...].Id"
            ]
        },
        "previous": {
            "deletedControls": [
                {/*Entire Control[1] Object*/},
                {/*Entire Control[2] Object*/},
                {/*Entire Control[..] Object*/},
            ]
        }   
    }
}
```

## ChangePropertyValue

```json
{
    "type": "ChangePropertyValue",
    "request": {
        "controlId": "Guid",
        "entityType": "Form|Control",
        "Property":{
            "Path": "",
            "Value": "",
        }
    },
    "State": {
        "current": {
            "Value": "",
        },
        "previous": {
            "Value": "",
        }   
    }
}
```
