Lookup Event

Gets data from an event and adds it to a frame.

Parameters

NameDefaultMeaning
sourceThe name of the event source
prefixA prefix to be added to lookup value names
sufffixA suffix to be added to lookup value name
whereIf present, this condition must be met for the lookup to happen
keyThe name of the frame attribute used to in the lookup
rkeyThe name of the lookup table column/property that matches the key
urlThe URL to download the content from
globalfalseIf true, this resource is loaded once for the entire time range
timeany'any', 'within', 'before' or 'after' adjusts which events are acceptable

Description

This function searches for any events that happen in or around the active time-frame and adds the event information in with the rest of the captured data.

This is often used to capture information about production batches or inspections.

Time

The time parameter specifies where the event should be.

ANY: The event will be added no matter when the event was seen.
WITHIN: The event will be used only if it happens inside the time frame.
BEFORE: The event will be used only if it happens during or before the time frame.
AFTER: The event will be used only if it happens during or after the time frame.

Where

The where condition is checked on the event. For example, events might include a 'Urgency' property with a value of 1 for urgent items.

Your layer can include a condition like…

   where: "{Urgency} == 1"

…so that only those events marked as 'urgent' would be attached to the frame.

Example

If the frame contains the following attributes…

AttributeValue
StartTime10:00AM
EndTime11:00AM
Order8830

and we have the following events…

TimePOrderQualityFinalResponse
8:00AM8829Good1OK
9:00AM8830Bad0Bad Paint
9:20AM8830Bad1Bad Paint
11:15AM8830Good1OK
12:20AM8831Bad0Throw Out
{
   "type": "lookup_event",
   "source": "Inspections"
   "key": "Order",
   "rkey" : "POrder",
   "prefix": "Inspection ",
   "where": "{Final} == 1"
}

Would result in the following…

AttributeValue
StartTime10:00AM
EndTime11:00AM
Order8830
Inspection QualityGood
Inspection Final1
Inspection ResponseOK