# linkset_data

*LSL event*

```lsl
linkset_data(integer action, string name, string value)
```

- `integer action`: An integer constant representing the action taken (e.g., LINKSETDATA_UPDATE, LINKSETDATA_DELETE, LINKSETDATA_RESET).
- `string name`: Key name of the modified key-value pair.
- `string value`: New string value of the pair (empty if the pair was deleted or is password-protected).

This event fires in all scripts in a linkset whenever the datastore is changed.

The linkset_data event fires in all scripts in a linkset whenever the datastore has been modified through a call to one of the **llLinksetData** functions.

```lsl title="How to use" frame="terminal"
linkset_data(integer action, string name, string value)
{

}
```

## Specification

| Constant |  | Description |
| --- | --- | --- |
| [LINKSETDATA_RESET](/constants/LINKSETDATA_RESET/) | 0 | The linkset's datastore has been cleared by a call to [llLinksetDataReset](/functions/llLinksetDataReset/). |
| [LINKSETDATA_UPDATE](/constants/LINKSETDATA_UPDATE/) | 1 | A **key** in the linkset's datastore has been assigned a new **value** with [llLinksetDataWrite](/functions/llLinksetDataWrite/) |
| [LINKSETDATA_DELETE](/constants/LINKSETDATA_DELETE/) | 2 | A **key** in the linkset's datastore has been deleted. Either through a call to [llLinksetDataDelete](/functions/llLinksetDataDelete/) or [llLinksetDataWrite](/functions/llLinksetDataWrite/) with an empty **value**. |
| [LINKSETDATA_MULTIDELETE](/constants/LINKSETDATA_MULTIDELETE/) | 3 | A comma separated list of the **keys** in the linkset's datastore which have been deleted through a call to [llLinksetDataDeleteFound](/functions/llLinksetDataDeleteFound/). |

## Examples

<details open>
<summary>Example 1</summary>

```lsl
default
{
    linkset_data(integer action, string name, string value)
    {
        if (action == LINKSETDATA_RESET)
        {
            llOwnerSay("Link set datastore has been cleared.");
            // name and value will both be empty strings, ""
        }
        else if (action == LINKSETDATA_DELETE)
        {
            llOwnerSay("Link set datastore key \"" + name + "\" has been deleted.");
            // value is an empty string, ""
        }
        else if (action == LINKSETDATA_UPDATE)
        {
            llOwnerSay("Link set datastore key \"" + name + "\" = \"" + value + "\".");
        }
    }
}
```

</details>

## See also

### Functions

- [llLinksetDataDelete](/functions/llLinksetDataDelete/)
- [llLinksetDataReset](/functions/llLinksetDataReset/)
- [llLinksetDataWrite](/functions/llLinksetDataWrite/)
- [llLinksetDataWriteProtected](/functions/llLinksetDataWriteProtected/)

---

*Source: [Linkset data](https://wiki.secondlife.com/wiki/Linkset_data) on the Second Life Wiki. Content from the Second Life Wiki articles Linkset data (revision 1216295, 2024-02-28) and Template:LSL Constants Linkset Data Events (revision 1214223, 2023-07-13), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/events/linkset_data/
