Skip to main content
Version: Next

Step 4: Label Scripts

Without a label script, EP shows the technical key of an entity in headers, tables and the graph. A label script computes a readable name instead. Background: Key and Label Scripts.

Label Script for Movie​

  1. Open the entity type Movie on the tab Data Sheet.

  2. Click next to Label Script. The script editor opens.

  3. Enter:

    local title = self.properties.title or "?"
    local year = self.properties.release_year
    if year then
    return title .. " (" .. year .. ")"
    end
    return title
  4. Close the editor. The script is saved.

Label Script for Actor​

Do the same on the entity type Actor:

return (self.properties.first_name or "") .. " " .. (self.properties.last_name or "")

Try It​

Create a new movie, or open Casablanca and change any field. The header now shows Casablanca (1942).

Existing entities

The label is computed when an entity is saved. Entities that existed before keep their old label until they are saved again — after Upgrade Entity Type or any change. Entities you import in the next step get the new label right away.

Ask the AI

Next to the script editor, the AI Low Code Generator helps you write and explain scripts — for example: "Return the title followed by the release year in parentheses; leave out the year if it is empty."

Next: Step 5: Import Data