---
title: "retrieving  a sample point as default value of coordinate attribute"
url: "https://openforis.support/questions/388/retrieving-a-sample-point-as-default-value-of-coordinate-attribute"
tags: ["collect"]
status: "accepted"
score: 0
answer_count: 1
asked: "2015-11-20T15:37:37"
last_activity: "2015-11-20T18:51:21"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# retrieving  a sample point as default value of coordinate attribute

Asked by mehrdad on 2015-11-20

I try to retrieving  a sample point as default value of coordinate attribute.I used the demo sample points. 

![alt text][1]

my retrieving expression in IDM Expression Language is  idm:samplingPointCoordinate(01,01). 

![alt text][2]

The coordinate system is also EPSG:4326 for my Survey.

in the preview I got empty form without default values.
 
![alt text][3]

my collect version is 3.8.19. 

let me know if I miss any detail
Thanks,

mehrdad


  [1]: http://www.openforis.org/support/upfiles/Unbenannt.PNG
  [2]: http://www.openforis.org/support/upfiles/Unbenannt3.PNG
  [3]: http://www.openforis.org/support/upfiles/Unbenannt2.PNG


## Accepted answer (score 1, by Stefano (OF) on 2015-11-20)

Link: https://openforis.support/questions/388/retrieving-a-sample-point-as-default-value-of-coordinate-attribute/389

Hi,  
the expression is "almost" correct... the only thing to change is that the parameters must be text values, like this:  
*idm:samplingPointCoordinate('01','01')*  
In this way the retrieved coordinate will always be the one corresponding to level_1='01' and level_2='01', is it the behaviour you are expecting? It will be more useful to have a dynamic lookup of that coordinate, specifying a path to an attribute instead of a constant value.  
Many thanks,  
Open Foris Team

> now its work..! :) you right,that way is much more flexible. Now for a test I change it to idm:samplingPointCoordinate(concat('0',idm:position())) and work perfectly. Thanks. (mehrdad)
