Using Chatbox.qs
This page is about reading one conversation: what each message shows, which side it is drawn on, its details, and the settings that decide how much fits. The pages under it take one subject each:
| Page | Covers |
|---|---|
| Conversations side by side | A lane per conversation, how they are chosen and ranked, scrolling them together, and selecting one by its header |
| Whole conversations | Selecting a person and getting back every conversation they are in, whole |
| Selecting from the conversation | What a click on a message selects, and what the object says when it cannot |
| Searching and stepping | The find box, stepping through matches and keywords, and the overview ruler |
| Copying and exporting | The conversation as a transcript or as JSON, one message on its own, and exports |
The conversation
Every message the selections leave is a bubble, in time order: by Timestamp (numeric) under Message metadata, or by Message ID where there is no timestamp. Behaviour → Message order starts from the oldest or from the newest.
- Each person has a colour from the app theme's palette, picked by the person's place in the data model rather than by the order they appear in. A person keeps their colour whatever is selected and however far the conversation is scrolled. Two people share one only when there are more people than the palette has colours.
- A header starts a run of messages: the avatar, the sender's name and, where there is a To dimension, an arrow and the recipients — up to three names, then and 2 more, all of them in its tooltip. A sender's next messages share the header until the recipients change, the side changes, or more than Group messages within (seconds) passes between two messages — 120 by default, under Appearance.
- The time under a message is what Timestamp (display) returns, and Badge text sits beside it. Accent colour colours the bubble's rail.
- The avatar is the picture at Avatar URL — an
https://address, or a content library path such as/content/Default/ada.png— or else the sender's initials. It is drawn once per run, and Appearance → Show avatars turns avatars off. - Measures after the first two are the message's KPIs, shown in its details.
- Kinds as chips: with Show kinds as chips on under Message metadata, a message's kinds sit above its text as chips — tags, labels, a ticket's categories. Below.
- The body is plain text, or markdown with Behaviour → Message body set to Markdown: rendered without raw HTML, with links that open in a new tab. Markdown is off by default because field values often hold
*,_and#it would reformat.
Days
With Appearance → Date separators on, a line marks each new day: Today, Yesterday, or the date, written the way the reader's browser writes dates, with the year only when it is not the current one.
A Qlik timestamp has no time zone, so a message stays under the date the data holds wherever the reader is: a message at 23:30 on 8 September is under 8 September in Stockholm and in New York alike. Today and Yesterday are the reader's own, by their clock. A timestamp in Unix time — seconds or milliseconds since 1970 — is a real moment instead, and is dated by the reader's clock.
The time order needs Timestamp (numeric): the Message ID is sorted by it, and by the id only where two messages share a time, so ids need not rise over time. While the sheet is edited, the sort is saved with the object; before that, and in an app nobody can edit, each reader's session applies it without saving.
Kinds as chips
A message can have several kinds. Only() returns nothing for a message with more than one, so join them in Message kind: Concat(DISTINCT [MsgKind], ',').
- Kinds are separated by says what to split on: Comma (,), Semicolon (😉, Vertical bar (|), or Do not split, to keep the whole text as one kind. A comma also splits a value such as
1,000. Kinds are trimmed, and a kind that repeats is shown once. - Most chips per message — 3 by default, up to 20 — caps the chips on a bubble; the rest fold into one +N chip whose tooltip names them. At most 100 kinds are kept per message.
- A message made of several rows — one per recipient, say — shows the kinds of all of them.
- The details list every kind. Chips are not searched, and a click on one is a click on the message.
Two-sided layout
Appearance → Layout is Rail (any number of participants) by default: every message on one side, as a transcript. Two-sided (per conversation) puts one person on the right in each conversation, as a chat app does.
Each conversation is worked out on its own. Where there is a To dimension, a conversation is a pair of people writing to each other; otherwise it is a thread; with neither, the whole object is one.
- Own participant, under Appearance, goes on the right in every conversation they are part of, however many people are in it. It takes a name or an expression —
=OSUser()works, when it returns the name exactly as the data holds it. Case does not matter. - Otherwise, in a two-person conversation, the person with the most different people to talk to goes right — an agent, or the owner of an inbox, stays on one side throughout. Where the two are level, whoever wrote last goes right, so a single two-person chat looks as a chat app draws it.
- A conversation of three or more people with no Own participant among them stays on the left. A group message goes right only when its sender is on the right in each of its pairs.
Message metadata → Own message (1/0) outranks all of it, in any layout, Rail included: 1, or true, puts a message on the right; 0, or false, on the left; anything else leaves it to the rules. Only([Direction]) = 'outbound' works as it reads.
The sides are worked out from the messages loaded, so narrowing a selection to one conversation can move them. For sides that never move, set Own participant or Own message (1/0).
Details
A message's Details link — Hide details while they are open — shows everything the object has for it: its sender and recipients, up to fifty of them; the time it was sent; its thread, kind and badge; its KPIs, each with a small chart of it across the conversation; and any warning about the message. One message's details are open at a time.
Details → Show details as decides where they open:
| Choice | Where |
|---|---|
| Automatic (recommended) | A side pane when the object is at least 720 pixels wide; an overlay when it is at least 360 wide and 220 high; inline otherwise. With conversations side by side, an overlay rather than a side pane |
| Side pane | Beside the conversation, about a third of the object's width |
| Overlay | Over the messages, below the bar |
| Inline expansion | Under the message, with a Close button |
Reading a message's details selects nothing. Space or Enter on a message opens and closes them; Escape closes them.
The bar above the conversation
The line across the top of the object holds the object's controls, each group in a tinted pill so that one is never mistaken for another:
- The find box, with its count and ▲ ▼ to step through the matches — see Searching and stepping.
- Keywords: a swatch drawn as the highlights are, their count, and ◂ ▸ to step through them, while there are highlighted values — see Highlighting keywords.
- The conversations shown, ◂ 1–4 of 12 ▸, with conversations side by side and more of them than fit — see Conversations side by side.
- The whole-conversations button, two speech bubbles — see Whole conversations — and the Text size control, below.
On its left, the bar has the highlight summary, and the whole-conversations count while that is on. The highlight legend sits under it. On a narrow object the groups move below the summary rather than squeezing it.
Density and text size
Appearance → Density decides the spacing, the padding and the avatars:
| Density | Avatars | Text, with Text size on Follow density |
|---|---|---|
| Comfortable | 26 pixels | 13 pixels |
| Compact | 20 pixels | 12 pixels |
| Ultra compact | none | 11 pixels |
Automatic (recommended), the default, picks one for the space there is: Ultra compact at 320 pixels wide or less, Compact at 520 pixels wide or less or 260 pixels high or less, and Comfortable otherwise. A Sense object is often a small tile and occasionally full screen, so one fixed spacing is wrong at one end. With conversations side by side the space is each lane, which usually means Ultra compact — see density in narrow lanes.
Appearance → Text size sets the size of the conversation's text on its own: the bodies, the names, the times and badges, the kind chips, the day separators and the details. Follow density, the default, is 13, 12 or 11 pixels as above; the other choices are 10 px, 11 px, 12 px, 13 px, 14 px, 16 px, 18 px, 20 px and 24 px. Text size changes no spacing and no avatar: Density goes on deciding those.
- The Text size control in the bar is the reader's own, and is not saved. It gives way the moment the setting itself changes, so a developer who changes the size is not overruled by a reader's earlier choice. Appearance → Show text size control takes it out of the bar.
- The bar keeps its own size, so the controls never move under the pointer while a reader tries sizes. So do the banners, the lane headers and the notices.
- An image or PDF export uses the setting, not a reader's choice.
Long conversations
Behaviour → Virtualize long conversations, on by default, draws only the messages near the part of the conversation on the screen, so a long transcript stays quick to scroll. An image or PDF export draws every message, whatever it says.
How many messages are read at all is Behaviour → Maximum messages — see The data model.