Querying ODK table to get a choice list in a survey form

I am trying to write a query that will return a list of choices from a local table, but cannot find any resources to do this. The situation is this:

  1. I have a table of products which is maintained by the users in a survey form called products
  2. I would like a list of products (and perhaps prices) to be used for a select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table and query that?

Thanks in advance for any assisatance

Hi Paul,

What ODK tool are you using?

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry paulstorry@gmail.com wrote:

I am trying to write a query that will return a list of choices from a local table, but cannot find any resources to do this. The situation is this:

  1. I have a table of products which is maintained by the users in a survey form called products
  2. I would like a list of products (and perhaps prices) to be used for a select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table and query that?

Thanks in advance for any assisatance

--
You received this message because you are subscribed to the Google Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dear Support,

I am using ODK Collect in my Mobile device(Android). I am trying to define the below things but i am unable to set the range of 4 digit. I would request you to kindly response my request asap with solution.

A) Phone number should be 10 digit (it is accepting only 9 digit)
B) Select Three Major Reasons - Not able to set 3 multi selection options.
C) How to define nested loop.

Yaw,

I am using ODK Tables and ODK Survey (126); forms are being designed in
Excel and converted using the XLSXConverter in ApplicationDesigner and
pushed to the mobile devices.
Paul

··· On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa wrote:

Hi Paul,

What ODK tool are you using?

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry paulstorry@gmail.com wrote:

I am trying to write a query that will return a list of choices from a
local table, but cannot find any resources to do this. The situation is
this:

  1. I have a table of products which is maintained by the users in a
    survey form called products
  2. I would like a list of products (and perhaps prices) to be used for a
    select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table and
query that?

Thanks in advance for any assisatance

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi there,

Please look at the resources at
https://opendatakit.org/help/form-design and search the community
lists. These questions have been answered plenty of times.

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Fri, Feb 5, 2016 at 9:00 PM, dkale23@gmail.com wrote:

Dear Support,

I am using ODK Collect in my Mobile device(Android). I am trying to define the below things but i am unable to set the range of 4 digit. I would request you to kindly response my request asap with solution.

A) Phone number should be 10 digit (it is accepting only 9 digit)
B) Select Three Major Reasons - Not able to set 3 multi selection options.
C) How to define nested loop.

--
You received this message because you are subscribed to the Google Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Look at the household and household-member forms.

The household uses a query against the household-members table to produce a
set of household members for a select and select_multiple prompt.

··· On Thu, Dec 10, 2015 at 12:29 AM, Paul Storry wrote:

Yaw,

I am using ODK Tables and ODK Survey (126); forms are being designed in
Excel and converted using the XLSXConverter in ApplicationDesigner and
pushed to the mobile devices.
Paul

On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa yanokwa@nafundi.com wrote:

Hi Paul,

What ODK tool are you using?

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry paulstorry@gmail.com wrote:

I am trying to write a query that will return a list of choices from a
local table, but cannot find any resources to do this. The situation is
this:

  1. I have a table of products which is maintained by the users in a
    survey form called products
  2. I would like a list of products (and perhaps prices) to be used for
    a select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table and
query that?

Thanks in advance for any assisatance

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

I've provided some sample forms that show how you could do this. I've
modified the household and the household_member forms to show how this can
be done. The original version of these files can be found in the
app-designer repository under the app/tables/household/forms/household_new
and the app/tables/household_member directories respectively. In
particular, you will want to pay attention to the queries worksheet of the
household_new form. Here you can see that I've used a linked_table query
to get the values from another database table to create a values_list.
These corresponding choice lists are used in members worksheet of the
household_new.xlsx file. You will notice that I have a select_linked_data
values_list and a select_linked_age values_list on the queries worksheet of
the household_new.xlsx file. Although these two tables use data from the
same table, the value that is returned for the values_list is different
based on what the instance_name in the settings worksheet of the form. For
example, the ageTest.xlsx file has the instance_name set to age, thus the
values_list for the select_linked_age query will be populated with ages.
On the settings worksheet of the member.xlsx file, the instance_name is set
to name, thus the values_list for the select_linked_data will consist of
names from the household_member table. If this solution does not work for
you, feel free to send in a more specific example of what you are trying to
do.

Clarice

exampleSelectForms.zip (55.9 KB)

··· On Thu, Dec 10, 2015 at 12:29 AM, Paul Storry wrote:

Yaw,

I am using ODK Tables and ODK Survey (126); forms are being designed in
Excel and converted using the XLSXConverter in ApplicationDesigner and
pushed to the mobile devices.
Paul

On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa yanokwa@nafundi.com wrote:

Hi Paul,

What ODK tool are you using?

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry paulstorry@gmail.com wrote:

I am trying to write a query that will return a list of choices from a
local table, but cannot find any resources to do this. The situation is
this:

  1. I have a table of products which is maintained by the users in a
    survey form called products
  2. I would like a list of products (and perhaps prices) to be used for
    a select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table and
query that?

Thanks in advance for any assisatance

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thank you very much these examples are very helpful.

··· On Fri, Dec 11, 2015 at 12:08 AM, clarice larson wrote:

I've provided some sample forms that show how you could do this. I've
modified the household and the household_member forms to show how this can
be done. The original version of these files can be found in the
app-designer repository under the app/tables/household/forms/household_new
and the app/tables/household_member directories respectively. In
particular, you will want to pay attention to the queries worksheet of the
household_new form. Here you can see that I've used a linked_table query
to get the values from another database table to create a values_list.
These corresponding choice lists are used in members worksheet of the
household_new.xlsx file. You will notice that I have a select_linked_data
values_list and a select_linked_age values_list on the queries worksheet of
the household_new.xlsx file. Although these two tables use data from the
same table, the value that is returned for the values_list is different
based on what the instance_name in the settings worksheet of the form. For
example, the ageTest.xlsx file has the instance_name set to age, thus the
values_list for the select_linked_age query will be populated with ages.
On the settings worksheet of the member.xlsx file, the instance_name is set
to name, thus the values_list for the select_linked_data will consist of
names from the household_member table. If this solution does not work for
you, feel free to send in a more specific example of what you are trying to
do.

Clarice

On Thu, Dec 10, 2015 at 12:29 AM, Paul Storry paulstorry@gmail.com wrote:

Yaw,

I am using ODK Tables and ODK Survey (126); forms are being designed in
Excel and converted using the XLSXConverter in ApplicationDesigner and
pushed to the mobile devices.
Paul

On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa yanokwa@nafundi.com wrote:

Hi Paul,

What ODK tool are you using?

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry paulstorry@gmail.com wrote:

I am trying to write a query that will return a list of choices from a
local table, but cannot find any resources to do this. The situation is
this:

  1. I have a table of products which is maintained by the users in a
    survey form called products
  2. I would like a list of products (and perhaps prices) to be used for
    a select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table and
query that?

Thanks in advance for any assisatance

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hello Clarice,

Your examples were helpful in that I can now select values from from a
table in a form. I have another requirement relating to querying existing
data. I have a table which contains products and prices. In my Sales form,
I select a product in a select_one type using a linked_table query and
capture a quantity. Once a product and quantity has been captured, I would
like to be able to query the product table again to get the price of the
selected product and calculate the total cost of the sale. How can I query
the product table to assign a value to the unit cost for the calculation.

Paul

··· On Friday, 11 December 2015 00:08:15 UTC+2, clarice larson wrote: > > I've provided some sample forms that show how you could do this. I've > modified the household and the household_member forms to show how this can > be done. The original version of these files can be found in the > app-designer repository under the app/tables/household/forms/household_new > and the app/tables/household_member directories respectively. In > particular, you will want to pay attention to the queries worksheet of the > household_new form. Here you can see that I've used a linked_table query > to get the values from another database table to create a values_list. > These corresponding choice lists are used in members worksheet of the > household_new.xlsx file. You will notice that I have a select_linked_data > values_list and a select_linked_age values_list on the queries worksheet of > the household_new.xlsx file. Although these two tables use data from the > same table, the value that is returned for the values_list is different > based on what the instance_name in the settings worksheet of the form. For > example, the ageTest.xlsx file has the instance_name set to age, thus the > values_list for the select_linked_age query will be populated with ages. > On the settings worksheet of the member.xlsx file, the instance_name is set > to name, thus the values_list for the select_linked_data will consist of > names from the household_member table. If this solution does not work for > you, feel free to send in a more specific example of what you are trying to > do. > > Clarice > > On Thu, Dec 10, 2015 at 12:29 AM, Paul Storry <pauls...@gmail.com > wrote: > >> Yaw, >> >> I am using ODK Tables and ODK Survey (126); forms are being designed in >> Excel and converted using the XLSXConverter in ApplicationDesigner and >> pushed to the mobile devices. >> Paul >> >> On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa <yan...@nafundi.com > wrote: >> >>> Hi Paul, >>> >>> What ODK tool are you using? >>> >>> Yaw >>> -- >>> Need ODK consultants? Nafundi provides form design, server setup, >>> in-field training, and software development for ODK. Go to >>> https://nafundi.com to get started. >>> >>> On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry <pauls...@gmail.com > wrote: >>> > I am trying to write a query that will return a list of choices from a >>> local table, but cannot find any resources to do this. The situation is >>> this: >>> > 1. I have a table of products which is maintained by the users in a >>> survey form called products >>> > 2. I would like a list of products (and perhaps prices) to be used for >>> a select_multiple type question in a sales form. >>> > >>> > Is this possible, or will I need to generate a csv from the table and >>> query that? >>> > >>> > Thanks in advance for any assisatance >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups "ODK Developers" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> an email to opendatakit-developers+unsubscribe@googlegroups.com >>> . >>> > For more options, visit https://groups.google.com/d/optout. >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "ODK Developers" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe >>> . >>> To unsubscribe from this group and all its topics, send an email to >>> opendatakit-developers+unsubscribe@googlegroups.com . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "ODK Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit-developers+unsubscribe@googlegroups.com >> . >> For more options, visit https://groups.google.com/d/optout. >> > >

I'm glad that the examples were useful. I've attached another set of
examples based off of the previous set sent on 12/10. In order to
accomplish what you need to do, I would use a custom prompt in which you
can asynchronously assign the value that you need from your product table
to a variable in your sales form. An example of how to do this is in our
app-designer repo under the app/tables/agriculture/forms/agriculture
directory. In the attached example zip file, the async_assign prompts are
in the exampleAsyncAssign/household/forms/household_new directory. You
will want to look at the customPromptTypes.js file to see the JavaScript
code for the async_assign_num_value and async_assign_text_value prompts.
The household_new.xlsx has a worksheet named prompt_types where these two
prompts are defined. On the queries sheet, you can see how these prompts
query another table to get their data. Finally, an example of how to use
them is on the member worksheet.

Clarice

exampleAsyncAssign.zip (55.2 KB)

··· On Tue, Dec 15, 2015 at 7:45 AM, Paul Storry wrote:

Hello Clarice,

Your examples were helpful in that I can now select values from from a
table in a form. I have another requirement relating to querying existing
data. I have a table which contains products and prices. In my Sales form,
I select a product in a select_one type using a linked_table query and
capture a quantity. Once a product and quantity has been captured, I would
like to be able to query the product table again to get the price of the
selected product and calculate the total cost of the sale. How can I query
the product table to assign a value to the unit cost for the calculation.

Paul

On Friday, 11 December 2015 00:08:15 UTC+2, clarice larson wrote:

I've provided some sample forms that show how you could do this. I've
modified the household and the household_member forms to show how this can
be done. The original version of these files can be found in the
app-designer repository under the app/tables/household/forms/household_new
and the app/tables/household_member directories respectively. In
particular, you will want to pay attention to the queries worksheet of the
household_new form. Here you can see that I've used a linked_table query
to get the values from another database table to create a values_list.
These corresponding choice lists are used in members worksheet of the
household_new.xlsx file. You will notice that I have a select_linked_data
values_list and a select_linked_age values_list on the queries worksheet of
the household_new.xlsx file. Although these two tables use data from the
same table, the value that is returned for the values_list is different
based on what the instance_name in the settings worksheet of the form. For
example, the ageTest.xlsx file has the instance_name set to age, thus the
values_list for the select_linked_age query will be populated with ages.
On the settings worksheet of the member.xlsx file, the instance_name is set
to name, thus the values_list for the select_linked_data will consist of
names from the household_member table. If this solution does not work for
you, feel free to send in a more specific example of what you are trying to
do.

Clarice

On Thu, Dec 10, 2015 at 12:29 AM, Paul Storry pauls...@gmail.com wrote:

Yaw,

I am using ODK Tables and ODK Survey (126); forms are being designed in
Excel and converted using the XLSXConverter in ApplicationDesigner and
pushed to the mobile devices.
Paul

On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa yan...@nafundi.com wrote:

Hi Paul,

What ODK tool are you using?

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry pauls...@gmail.com wrote:

I am trying to write a query that will return a list of choices from
a local table, but cannot find any resources to do this. The situation is
this:

  1. I have a table of products which is maintained by the users in a
    survey form called products
  2. I would like a list of products (and perhaps prices) to be used
    for a select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table and
query that?

Thanks in advance for any assisatance

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hello Clarice
Thanks for the additional examples. I now have things working pretty much
as a I want them. I have one more (hopefully final) question. I am adding
products to a sale using the linked table instructions you gave me
previously. When I reach this point in the survey form, it lists the
product items that form part of the sale.The page thathows this list has
headers "Last Saved", "Name", "Finalised", and gives me some columns back
from the previously added instances. Unfortunately, it is not displaying
the information I would like to see. I would like to see product, quantity,
unit cost and total price. I am assuming that i need to do this with some
handlebars template, but cannot see where or how to do this.
Thanking you for your assistance in advance again.

Paul

··· On Tuesday, 15 December 2015 22:51:14 UTC+2, clarice larson wrote: > > I'm glad that the examples were useful. I've attached another set of > examples based off of the previous set sent on 12/10. In order to > accomplish what you need to do, I would use a custom prompt in which you > can asynchronously assign the value that you need from your product table > to a variable in your sales form. An example of how to do this is in our > app-designer repo under the app/tables/agriculture/forms/agriculture > directory. In the attached example zip file, the async_assign prompts are > in the exampleAsyncAssign/household/forms/household_new directory. You > will want to look at the customPromptTypes.js file to see the JavaScript > code for the async_assign_num_value and async_assign_text_value prompts. > The household_new.xlsx has a worksheet named prompt_types where these two > prompts are defined. On the queries sheet, you can see how these prompts > query another table to get their data. Finally, an example of how to use > them is on the member worksheet. > > Clarice > > On Tue, Dec 15, 2015 at 7:45 AM, Paul Storry <pauls...@gmail.com > wrote: > >> Hello Clarice, >> >> Your examples were helpful in that I can now select values from from a >> table in a form. I have another requirement relating to querying existing >> data. I have a table which contains products and prices. In my Sales form, >> I select a product in a select_one type using a linked_table query and >> capture a quantity. Once a product and quantity has been captured, I would >> like to be able to query the product table again to get the price of the >> selected product and calculate the total cost of the sale. How can I query >> the product table to assign a value to the unit cost for the calculation. >> >> Paul >> >> On Friday, 11 December 2015 00:08:15 UTC+2, clarice larson wrote: >>> >>> I've provided some sample forms that show how you could do this. I've >>> modified the household and the household_member forms to show how this can >>> be done. The original version of these files can be found in the >>> app-designer repository under the app/tables/household/forms/household_new >>> and the app/tables/household_member directories respectively. In >>> particular, you will want to pay attention to the queries worksheet of the >>> household_new form. Here you can see that I've used a linked_table query >>> to get the values from another database table to create a values_list. >>> These corresponding choice lists are used in members worksheet of the >>> household_new.xlsx file. You will notice that I have a select_linked_data >>> values_list and a select_linked_age values_list on the queries worksheet of >>> the household_new.xlsx file. Although these two tables use data from the >>> same table, the value that is returned for the values_list is different >>> based on what the instance_name in the settings worksheet of the form. For >>> example, the ageTest.xlsx file has the instance_name set to age, thus the >>> values_list for the select_linked_age query will be populated with ages. >>> On the settings worksheet of the member.xlsx file, the instance_name is set >>> to name, thus the values_list for the select_linked_data will consist of >>> names from the household_member table. If this solution does not work for >>> you, feel free to send in a more specific example of what you are trying to >>> do. >>> >>> Clarice >>> >>> On Thu, Dec 10, 2015 at 12:29 AM, Paul Storry wrote: >>> >>>> Yaw, >>>> >>>> I am using ODK Tables and ODK Survey (126); forms are being designed in >>>> Excel and converted using the XLSXConverter in ApplicationDesigner and >>>> pushed to the mobile devices. >>>> Paul >>>> >>>> On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa wrote: >>>> >>>>> Hi Paul, >>>>> >>>>> What ODK tool are you using? >>>>> >>>>> Yaw >>>>> -- >>>>> Need ODK consultants? Nafundi provides form design, server setup, >>>>> in-field training, and software development for ODK. Go to >>>>> https://nafundi.com to get started. >>>>> >>>>> On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry wrote: >>>>> > I am trying to write a query that will return a list of choices from >>>>> a local table, but cannot find any resources to do this. The situation is >>>>> this: >>>>> > 1. I have a table of products which is maintained by the users in a >>>>> survey form called products >>>>> > 2. I would like a list of products (and perhaps prices) to be used >>>>> for a select_multiple type question in a sales form. >>>>> > >>>>> > Is this possible, or will I need to generate a csv from the table >>>>> and query that? >>>>> > >>>>> > Thanks in advance for any assisatance >>>>> > >>>>> > -- >>>>> > You received this message because you are subscribed to the Google >>>>> Groups "ODK Developers" group. >>>>> > To unsubscribe from this group and stop receiving emails from it, >>>>> send an email to opendatakit-developers+unsubscribe@googlegroups.com. >>>>> > For more options, visit https://groups.google.com/d/optout. >>>>> >>>>> -- >>>>> You received this message because you are subscribed to a topic in the >>>>> Google Groups "ODK Developers" group. >>>>> To unsubscribe from this topic, visit >>>>> https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe >>>>> . >>>>> To unsubscribe from this group and all its topics, send an email to >>>>> opendatakit-developers+unsubscribe@googlegroups.com. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "ODK Developers" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to opendatakit-developers+unsubscribe@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "ODK Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit-developers+unsubscribe@googlegroups.com >> . >> For more options, visit https://groups.google.com/d/optout. >> > >

I would recommend using a custom screen to accomplish this. If you create
a handlebars file that displays an HTML table, then you should be able to
place the data from other prompts within the table. We have a few examples
of how to do this in the jan2015 branch of the app-designer repo. The
simplest example is under app/tables/gridScreen/forms/gridScreen. Some
more complicated examples can be found at
app/tables/adult_coverage/forms/adult_coverage and
app/tables/child_coverage/forms/child_coverage.

Clarice

··· On Thu, Dec 17, 2015 at 11:07 AM, Paul Storry wrote:

Hello Clarice
Thanks for the additional examples. I now have things working pretty much
as a I want them. I have one more (hopefully final) question. I am adding
products to a sale using the linked table instructions you gave me
previously. When I reach this point in the survey form, it lists the
product items that form part of the sale.The page thathows this list has
headers "Last Saved", "Name", "Finalised", and gives me some columns back
from the previously added instances. Unfortunately, it is not displaying
the information I would like to see. I would like to see product, quantity,
unit cost and total price. I am assuming that i need to do this with some
handlebars template, but cannot see where or how to do this.
Thanking you for your assistance in advance again.

Paul

On Tuesday, 15 December 2015 22:51:14 UTC+2, clarice larson wrote:

I'm glad that the examples were useful. I've attached another set of
examples based off of the previous set sent on 12/10. In order to
accomplish what you need to do, I would use a custom prompt in which you
can asynchronously assign the value that you need from your product table
to a variable in your sales form. An example of how to do this is in our
app-designer repo under the app/tables/agriculture/forms/agriculture
directory. In the attached example zip file, the async_assign prompts are
in the exampleAsyncAssign/household/forms/household_new directory. You
will want to look at the customPromptTypes.js file to see the JavaScript
code for the async_assign_num_value and async_assign_text_value prompts.
The household_new.xlsx has a worksheet named prompt_types where these two
prompts are defined. On the queries sheet, you can see how these prompts
query another table to get their data. Finally, an example of how to use
them is on the member worksheet.

Clarice

On Tue, Dec 15, 2015 at 7:45 AM, Paul Storry pauls...@gmail.com wrote:

Hello Clarice,

Your examples were helpful in that I can now select values from from a
table in a form. I have another requirement relating to querying existing
data. I have a table which contains products and prices. In my Sales form,
I select a product in a select_one type using a linked_table query and
capture a quantity. Once a product and quantity has been captured, I would
like to be able to query the product table again to get the price of the
selected product and calculate the total cost of the sale. How can I query
the product table to assign a value to the unit cost for the calculation.

Paul

On Friday, 11 December 2015 00:08:15 UTC+2, clarice larson wrote:

I've provided some sample forms that show how you could do this. I've
modified the household and the household_member forms to show how this can
be done. The original version of these files can be found in the
app-designer repository under the app/tables/household/forms/household_new
and the app/tables/household_member directories respectively. In
particular, you will want to pay attention to the queries worksheet of the
household_new form. Here you can see that I've used a linked_table query
to get the values from another database table to create a values_list.
These corresponding choice lists are used in members worksheet of the
household_new.xlsx file. You will notice that I have a select_linked_data
values_list and a select_linked_age values_list on the queries worksheet of
the household_new.xlsx file. Although these two tables use data from the
same table, the value that is returned for the values_list is different
based on what the instance_name in the settings worksheet of the form. For
example, the ageTest.xlsx file has the instance_name set to age, thus the
values_list for the select_linked_age query will be populated with ages.
On the settings worksheet of the member.xlsx file, the instance_name is set
to name, thus the values_list for the select_linked_data will consist of
names from the household_member table. If this solution does not work for
you, feel free to send in a more specific example of what you are trying to
do.

Clarice

On Thu, Dec 10, 2015 at 12:29 AM, Paul Storry pauls...@gmail.com wrote:

Yaw,

I am using ODK Tables and ODK Survey (126); forms are being designed
in Excel and converted using the XLSXConverter in ApplicationDesigner and
pushed to the mobile devices.
Paul

On Thu, Dec 10, 2015 at 10:25 AM, Yaw Anokwa yan...@nafundi.com wrote:

Hi Paul,

What ODK tool are you using?

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 2:35 PM, Paul Storry pauls...@gmail.com wrote:

I am trying to write a query that will return a list of choices
from a local table, but cannot find any resources to do this. The situation
is this:

  1. I have a table of products which is maintained by the users in a
    survey form called products
  2. I would like a list of products (and perhaps prices) to be used
    for a select_multiple type question in a sales form.

Is this possible, or will I need to generate a csv from the table
and query that?

Thanks in advance for any assisatance

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/-rShnnqXVe0/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.