Control.query based upon RowId

I have a html form that allows me to select a userid and redirect to a
sales html form with the Rowid (guid) passed through the querystring. I
then want to access some information about that user on the new page but i
cannot query the user table based upon this RowId

I tried control.query and used '_uri' as the search field, but that throws
an error - so how am i able to query the table based upon a known RowId?

Thanks
Andrew

In ODK 2.0, the instanceId / rowId is in the _id column (this is a change
from the naming of columns in the 1.x data tables in ODK Aggregate).

··· On Thu, Dec 17, 2015 at 5:32 AM, Andrew de Klerk wrote:

I have a html form that allows me to select a userid and redirect to a
sales html form with the Rowid (guid) passed through the querystring. I
then want to access some information about that user on the new page but i
cannot query the user table based upon this RowId

I tried control.query and used '_uri' as the search field, but that throws
an error - so how am i able to query the table based upon a known RowId?

Thanks
Andrew

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

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

thanks mitch - will try that tomorrow

··· On Thursday, 17 December 2015 20:01:23 UTC+2, Mitch Sundt wrote: > > In ODK 2.0, the instanceId / rowId is in the _id column (this is a change > from the naming of columns in the 1.x data tables in ODK Aggregate). > > > > On Thu, Dec 17, 2015 at 5:32 AM, Andrew de Klerk <andrew....@gmail.com > wrote: > >> I have a html form that allows me to select a userid and redirect to a >> sales html form with the Rowid (guid) passed through the querystring. I >> then want to access some information about that user on the new page but i >> cannot query the user table based upon this RowId >> >> I tried control.query and used '_uri' as the search field, but that >> throws an error - so how am i able to query the table based upon a known >> RowId? >> >> Thanks >> Andrew >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "ODK Community" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

Hi Mitch

I am still not having any joy. If I say:

data.getColumns()

I get

"{"mobile_main":"String","town":"String","wakala":"String","mobile_1":"String","user_type":"String","surname":"String","name":"String","village":"String"}"

i.e. it is only the fields we have added in the form design. I am trying to
do the following to get a record of the entire row for that user based upon
their id (guid):

var userlist = control.query(
'user',
'_id = ?',
[userid]);
I hope this makes sense

··· On Thursday, 17 December 2015 20:01:23 UTC+2, Mitch Sundt wrote: > > In ODK 2.0, the instanceId / rowId is in the _id column (this is a change > from the naming of columns in the 1.x data tables in ODK Aggregate). > > > > On Thu, Dec 17, 2015 at 5:32 AM, Andrew de Klerk <andrew....@gmail.com > wrote: > >> I have a html form that allows me to select a userid and redirect to a >> sales html form with the Rowid (guid) passed through the querystring. I >> then want to access some information about that user on the new page but i >> cannot query the user table based upon this RowId >> >> I tried control.query and used '_uri' as the search field, but that >> throws an error - so how am i able to query the table based upon a known >> RowId? >> >> Thanks >> Andrew >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "ODK Community" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

as a solution we have created our own auto-incrementing user id and are
using that. I would still be interested to know if what i wanted to do is
still possible

··· On Friday, 18 December 2015 11:00:28 UTC+2, Andrew de Klerk wrote: > > Hi Mitch > > I am still not having any joy. If I say: > > data.getColumns() > > I get > > > "{"mobile_main":"String","town":"String","wakala":"String","mobile_1":"String","user_type":"String","surname":"String","name":"String","village":"String"}" > > i.e. it is only the fields we have added in the form design. I am trying > to do the following to get a record of the entire row for that user based > upon their id (guid): > > var userlist = control.query( > 'user', > '_id = ?', > [userid]); > I hope this makes sense > > On Thursday, 17 December 2015 20:01:23 UTC+2, Mitch Sundt wrote: >> >> In ODK 2.0, the instanceId / rowId is in the _id column (this is a change >> from the naming of columns in the 1.x data tables in ODK Aggregate). >> >> >> >> On Thu, Dec 17, 2015 at 5:32 AM, Andrew de Klerk wrote: >> >>> I have a html form that allows me to select a userid and redirect to a >>> sales html form with the Rowid (guid) passed through the querystring. I >>> then want to access some information about that user on the new page but i >>> cannot query the user table based upon this RowId >>> >>> I tried control.query and used '_uri' as the search field, but that >>> throws an error - so how am i able to query the table based upon a known >>> RowId? >>> >>> Thanks >>> Andrew >>> >>> -- >>> -- >>> Post: opend...@googlegroups.com >>> Unsubscribe: opendatakit...@googlegroups.com >>> Options: http://groups.google.com/group/opendatakit?hl=en >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "ODK Community" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to opendatakit...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Mitch Sundt >> Software Engineer >> University of Washington >> mitche...@gmail.com >> >

You should be able to call userlist.getColumns() based on your previous
example. Are you encountering an error when you do this?

Clarice

··· On Fri, Dec 18, 2015 at 4:14 AM, Andrew de Klerk wrote:

as a solution we have created our own auto-incrementing user id and are
using that. I would still be interested to know if what i wanted to do is
still possible

On Friday, 18 December 2015 11:00:28 UTC+2, Andrew de Klerk wrote:

Hi Mitch

I am still not having any joy. If I say:

data.getColumns()

I get

"{"mobile_main":"String","town":"String","wakala":"String","mobile_1":"String","user_type":"String","surname":"String","name":"String","village":"String"}"

i.e. it is only the fields we have added in the form design. I am trying
to do the following to get a record of the entire row for that user based
upon their id (guid):

var userlist = control.query(
'user',
'_id = ?',
[userid]);
I hope this makes sense

On Thursday, 17 December 2015 20:01:23 UTC+2, Mitch Sundt wrote:

In ODK 2.0, the instanceId / rowId is in the _id column (this is a
change from the naming of columns in the 1.x data tables in ODK Aggregate).

On Thu, Dec 17, 2015 at 5:32 AM, Andrew de Klerk andrew....@gmail.com wrote:

I have a html form that allows me to select a userid and redirect to a
sales html form with the Rowid (guid) passed through the querystring. I
then want to access some information about that user on the new page but i
cannot query the user table based upon this RowId

I tried control.query and used '_uri' as the search field, but that
throws an error - so how am i able to query the table based upon a known
RowId?

Thanks
Andrew

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

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

--
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

Hi Clarice

That request above throws an error, but if I change the query to "surname"
and "xyx" and then run userlist.getColumns() then I get the same set of
columns. As mentioned, we have made a workaround by creating our own id.
Not ideal, but satisfactory enough

Andrew

··· On Friday, 18 December 2015 23:57:57 UTC+2, clarice larson wrote: > > You should be able to call userlist.getColumns() based on your previous > example. Are you encountering an error when you do this? > > Clarice > > On Fri, Dec 18, 2015 at 4:14 AM, Andrew de Klerk <andrew....@gmail.com > wrote: > >> as a solution we have created our own auto-incrementing user id and are >> using that. I would still be interested to know if what i wanted to do is >> still possible >> >> >> On Friday, 18 December 2015 11:00:28 UTC+2, Andrew de Klerk wrote: >>> >>> Hi Mitch >>> >>> I am still not having any joy. If I say: >>> >>> data.getColumns() >>> >>> I get >>> >>> >>> "{"mobile_main":"String","town":"String","wakala":"String","mobile_1":"String","user_type":"String","surname":"String","name":"String","village":"String"}" >>> >>> i.e. it is only the fields we have added in the form design. I am trying >>> to do the following to get a record of the entire row for that user based >>> upon their id (guid): >>> >>> var userlist = control.query( >>> 'user', >>> '_id = ?', >>> [userid]); >>> I hope this makes sense >>> >>> On Thursday, 17 December 2015 20:01:23 UTC+2, Mitch Sundt wrote: >>>> >>>> In ODK 2.0, the instanceId / rowId is in the _id column (this is a >>>> change from the naming of columns in the 1.x data tables in ODK Aggregate). >>>> >>>> >>>> >>>> On Thu, Dec 17, 2015 at 5:32 AM, Andrew de Klerk wrote: >>>> >>>>> I have a html form that allows me to select a userid and redirect to a >>>>> sales html form with the Rowid (guid) passed through the querystring. I >>>>> then want to access some information about that user on the new page but i >>>>> cannot query the user table based upon this RowId >>>>> >>>>> I tried control.query and used '_uri' as the search field, but that >>>>> throws an error - so how am i able to query the table based upon a known >>>>> RowId? >>>>> >>>>> Thanks >>>>> Andrew >>>>> >>>>> -- >>>>> -- >>>>> Post: opend...@googlegroups.com >>>>> Unsubscribe: opendatakit...@googlegroups.com >>>>> Options: http://groups.google.com/group/opendatakit?hl=en >>>>> >>>>> --- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "ODK Community" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to opendatakit...@googlegroups.com. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> >>>> -- >>>> Mitch Sundt >>>> Software Engineer >>>> University of Washington >>>> mitche...@gmail.com >>>> >>> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "ODK Community" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >