Add Temporary Events and URLs

In this scenario, you can use the createEvents() and table() functions combined to add new events to a table. You can also add field-related URLs and make those URLs linkable in your table, like in this Table widget:

Table with New Fields and URLs

Figure 223. Table with New Fields and URLs


  1. From the Search tab, type the following query:

    logscale
    createEvents(["animal=dog weight=10.0 url=\"[dog](https://google.com/search?q=dog)\"", "animal=cat weight=4.212 url=\"[cat](https://google.com/search?q=cat)\"", "animal=koala weight=6.300 url=\"[koala info](https://google.com/search?q=koala)\""])
    | kvParse()
    | table([animal, weight, url])

    The output table has newly created fields animal, weight and url as its columns.

  2. Save your widget as explained at Create Widgets

  3. Click the menu icon on top-right of the widget and select Styling, the Styling panel is displayed:

    Properties Panel - Example 2

    Figure 224. Properties Panel - Example 2


  4. Click the field animal in the Columns section and set properties like this:

    • Formatting → Show as Value → Format as Text

    • SizeFit to data

    • Cell colorsConditions because you want to assign a specific color for each different value (dog, cat, etc.).

  5. Click the field weight in the Columns section and set properties like this:

    • Formatting → Show as Value → Format as Number; you also want to round the values for the animal weight to 2 decimal places.

    • Cell colors → choose a Static color (yellow in the example) for any value.

  6. Click the field url in the Columns section and set in particular:

    Formatting → Show as Link because you want your URLs to be linkable. As seen in the example, labels for URLs are supported.

For all the available properties that you can use to customize your widget, see Table Property Reference.