Dear OF-team
How can I add data from a previous inventory using lookup?
I have a survey that is structured as follows: /reserve/plot/tree. Each plot has 1-3 marking points to identify the plot in the next inventory. Therefore, I would like to preset the coordinates from the previous inventory in the followup inventory.
However, I cannot use the sampling point data to get the preset data since all key-columns are used (level1_code=reserve, level2_code=plot, level3_code=tree).
The only solution I therefore see, is using idm:lookup.
I'm aware of this post and did the following.
- add a table
lu_testto thecollect.dbdatabase on collect desktop - create following table in collect desktop:
reserve plot marking_id value 9999 2 1 3.3 9999 2 2 10.1 9999 2 3 7.4 -
export the survey, unpack the
.collect-mobilefile and add this table to thecollect.dbdatabase in the export and pack the archive again -
import survey to OF collect-mobile
I have tried to create a calculated field to get values from this table with this code:
idm:lookup('lu_test', 'value', 'reserve',9999, 'plot',2, 'marking_id',1)
Note that I had to quote table- and column-names. Otherwise I get errors of the following kind:
Invalid expression: Node 'lu_test' not found
Invalid expression: Node 'value' not found
...
However, neither collect desktop nor collect mobile were able to retrieve any of these values. It seems that the lookup-table was not found.
Where am I wrong?
Thanks for your help,
Christoph