Minecraft wiki entry for scoreboard, associated text: Syntax
scoreboard objectives setdisplay <slot> [<objective>] (Java Edition)
scoreboard objectives setdisplay <list|sidebar> [objective: string] [ascending|descending] (Bedrock Edition)
scoreboard objectives setdisplay belowname [objective: string] (Bedrock Edition)
Description
Display score info for the objective in the given slot. Note that the objective parameter is optional; if no objective is provided, this display slot is cleared (returned to its default state). In Bedrock Edition, if slot is list or sidebar, there is an additional optional argument ascending|descending to specify the sort order.
Arguments
JE: <slot>: scoreboard_slot
BE: list|sidebar|belowname
Specifies the slot to display the objective.
Must be a scoreboard display slot. Valid slots are listed and described in Display Slots.
JE: <objective>: objective
BE: objective: string: basic_string
Specifies the internal objective name.
In Java Edition, it must be an valid scoreboard objective name. In Bedrock Edition, it must be either a single word that isn't a number (allowed characters: -, :, ., _, A-Z, a-z, and 0-9) or a double-quoted string.
BE: ascending|descending
Specifies the sort order.
Result
Command Trigger Java Edition Bedrock Edition
... setdisplay ... the arguments are not specified correctly Unparseable Failed
... setdisplay <slot> <objective>
... setdisplay ... [objective: string] <objective> doesn't exist Failed
<objective> already displays in the specified slot Successful
... setdisplay <slot>
... setdisplay <list|sidebar|belowname> the slot is already empty
any On success Display score info, or clear display slot.
Output
Command Edition Situation Success Count /execute store success ... /execute store result ...
... setdisplay ... Java Edition On fail 0 0 0
On success 1 1 0
Bedrock Edition On fail 0 N/A N/A
On success 1 N/A N/A