Hi,

is it possible to get help on how to integrate Sheetnode module with your own database. My objective is to load some custom data from e.g. MySQL database as soon as the sheet gets loaded.

A small example of how to actually inject random data to some cells from correct hook (_load?) would be more than helpful.

Comments

infojunkie’s picture

Status: Active » Fixed

You can currently load values from the database using the following functions: =ORG.DRUPAL.FIELD(field-name, [oid, entity-name]) to load a specific field value from an entity (e.g. node or user) given the entity's unique id. =ORG.DRUPAL.TOKEN(token, [oid, entity-name]) allows loading a token value from an entity, using the Token module.

There is no function to load an arbitrary column from an arbitrary table using SQL for example.

theme’s picture

Status: Fixed » Active

Unfortunately that didn't answer the question I had in mind.

Basically I'd like to inject PHP-code directly to the sheetnode.module file, most probably in sheetnode_load(?) hook which would statically set some cell data in the visible sheet.

What parameters/which datastructure need(s) to be set so that each time some user surfs to sheetnode it would have e.g. number 5.67 in cell A4?

infojunkie’s picture

Sheetnode has the concept of "templates", which act like the default value for a new spreadsheet. To create a template, create a new sheetnode and fill the "Save as template:" field with a name, which will be used to identify the template. Later, a user can click the "Sheetnode import from template" link (node/add/sheetnode_template) to choose to start a new spreadsheet from one of the available templates.

Does that help?

willhallonline’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

No plans for external database integrations.