---
name: "createDiaryLink"
type: command
status: ok
groups: ["Briefing"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/createDiaryLink
revid: 325179
updated: 2022-07-01T14:35:13Z
---

# createDiaryLink

*Command · Briefing · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Creates a link to the given diary entry.

## Syntax

```sqf
createDiaryLink [subject, record, text]
```

**Parameters:**

- `subject`: [String](../topics/String.md)
- `record`: [Object](../topics/Object.md), [Task](../topics/Task.md) or [Diary Record](../topics/Diary_Record.md)
- `text`: [String](../topics/String.md)

**Returns:** [String](../topics/String.md) - empty string or a string similar to the result of `format ["<log subject=""%1"" record=""%2"">%3</log>", subject, processedRecordId, text]`

## Examples

### Example 1

```sqf
_diaryRec1 = player createDiaryRecord ["Diary", ["Record 1", "We can not refer to the next record because it does not exist yet."]];
_diaryRec2 = player createDiaryRecord ["Diary", ["Record 2", "Go to " + createDiaryLink ["Diary", _diaryRec1, "record 1"]]];
_diaryRec3 = player createDiaryRecord ["Diary", ["Record 3", "Go to " + createDiaryLink ["Diary", _diaryRec2, "record 2"]]];
```

### Example 2

In this example, one can go to any next record.

```sqf
TAG_fnc_processDiaryLink = {
    processDiaryLink createDiaryLink ["Diary", _this, ""];
};
DiaryRec1 = player createDiaryRecord ["Diary", ["Record 1", 
    "Go to <execute expression='DiaryRec2 call TAG_fnc_processDiaryLink'>Record 2</execute>"
]];
DiaryRec2 = player createDiaryRecord ["Diary", ["Record 2", 
    "Go to <execute expression='DiaryRec3 call TAG_fnc_processDiaryLink'>Record 3</execute>"
]];
DiaryRec3 = player createDiaryRecord ["Diary", ["Record 3", 
    "Go to <execute expression='DiaryRec1 call TAG_fnc_processDiaryLink'>Record 1</execute>"
]];
```

## See also

[processDiaryLink](../commands/processDiaryLink.md) · [createDiaryRecord](../commands/createDiaryRecord.md) · [createDiarySubject](../commands/createDiarySubject.md) · [diarySubjectExists](../commands/diarySubjectExists.md) · [setDiaryRecordText](../commands/setDiaryRecordText.md)

<sub>Source: [BI Community Wiki — createDiaryLink](https://community.bistudio.com/wiki/createDiaryLink) (revision 325179).</sub>
