Infomaptic allows you to author templates. Each template has a data source assigned to it. When the template is converted into a Report, a single record is extracted from the data source (via the url parameter
key) and used to populate the data.
In some sense the formula for a report looks like this:
Report = Template + Record
Really a Report is built by combining a Template and a Record from a Data Source, so a better representation of it might be:
It might help to explain this in terms of an equation, something like this:
Report = Template + OneRecord(Data Source)
But to really understand what happens here, we need to define the function
OneRecord. Fortunately you do that when you define the Where Clause associated with the Data Source in the Template. The Where Clause that you specify should resolve a single record out of the Data Source, usually based on the query parameter
The default Where Clause is built using the ObjectID field of the Data Source, and usually looks something like this:
'ObjectId = ' + data.key.value
Which is actually just an Atelerix expression, so you can build any Where Clause that you like here*.
data.key.value resolves to the value that is specified in the URL Query parameter
key. This makes it easy for you to build a custom
OneRecord function by controlling how that
key value is used within the Where Clause.
Most of the time, the ObjectId default will suffice just fine. You just specify the record you want by its ObjectId. For example, in the Portland Area Farmer’s Markets example, the where clause is:
'OBJECTID = ' + data.key.Value
So if I wanted to load the Market called “Montavilla Farmers Market” I just need to know what ObjectID to use, in this case it’s 3, so I can construct the url as:
Which will create the where clause:
'OBJECTID = 3'
Note: You can see how the Where Clause and the URL key interact using the Publish Screen.
* Within reason anyway. We actually do a little processing to that
data.key.value to ensure that any SQL Injection type attacks stay out. We don’t want users to be able to alter the Where Clause by crafting a special key value. You can see more in our blog post Oh No! SQL Injection!.