has a table of salt content. We would like to import this into Data Blaze and include it in the medical record for foods that the patient often inoculates himself/herself with.
For example, if the patient drinks a lot of red wine, then
I want to state "Red wine contains (salt content retrieved from table) milligrams of salt per (weight retrieved from table) grams of red wine.
@scott
Thanks for your reply. For example, I would like to have a text field that says "Foods the patient eat often" and then search the table in Data Blaze for the food that is freely entered in the field.
If a match is found, I would like to display the text as follows: "(name of food) contains (x) g of salt". Is it possible?
Let's imagine you had a space with a table called Foods that looked like this:
Name, Salt
Pizza, 10
Hamburger, 20
Cabbage, 1
You could then write a snippet that queried it like so:
{formtext: name=food_name}
{dbselect: SELECT salt FROM foods WHERE name = @food_name; space=xyz123}
{=food_name} contains {=salt} g of salt.
That's just a start, you would want to add things like error handling in case the food wasn't found, but that's the basic gist.
Does that help?
Edited (added demo):
{formtext: name=food_name; default=Pizza}
{dbselect: SELECT salt FROM foods WHERE name = {=food_name}; space=id}
{=food_name} contains {=salt} g of salt.
We have a graphical editor for it when your editing the command in the dashboard that allows you to do simple things like this without writing any SQL directly.