---
title: "Default Expression Not Working!!"
url: "https://openforis.support/questions/734/default-expression-not-working"
tags: ["collect"]
status: "answered"
score: 0
answer_count: 1
asked: "2016-09-19T16:38:38"
last_activity: "2016-09-20T09:58:47"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Default Expression Not Working!!

Asked by dhunganamilan on 2016-09-19

Hello Support Team and Expert Users,

I am trying to get an attribute value automatically from one of the column in sampling point data. I wrote an Xpath expression (`idm:samplingPointData('slope', /col, /row, /number`)) to make the extracted attribute value as default value for the given attribute. But it didn't work. However if I use the same expression and calculate the value (i.e. tick the calculated button), it works. But I do not want to calculate the value, I just want to put that value as default as I might need to change the attribute value at some point. Anyone have any idea what is going wrong?

Thanks

Milan


## Answer (score 0, by Stefano (OF) on 2016-09-20)

Link: https://openforis.support/questions/734/default-expression-not-working/737

Dear Milan,  
That expression doesn't work as a default value expression because the default values are applied when you create a new record or you add a new entity, instead the calculated attributes are (re)calculated every time an attribute it depends on changes.  
Can we have more details about the structure of your survey? Maybe the default value is not applied correctly because, when the relative attribute it's created, the values of col row and number are not yet available.  
Thanks,  
Open Foris Team
