---
title: "How can I use the last() function to set default values?"
url: "https://openforis.support/questions/4451/how-can-i-use-the-last-function-to-set-default-values"
tags: ["openforis", "arena"]
status: "answered"
score: 0
answer_count: 1
asked: "2026-03-26T15:53:19"
last_activity: "2026-03-27T11:39:58"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# How can I use the last() function to set default values?

Asked by mdorigo on 2026-03-26

Hello, 

does anyone have problems using the last() function to set attribute's default values?

I am trying to use this expression but it always returns an empty field: 

last(dendro_visit).serialnr

I cannot figure out where the issue is. 

Thanks


## Answer (score 0, by Stefano (OF) on 2026-03-27)

Link: https://openforis.support/questions/4451/how-can-i-use-the-last-function-to-set-default-values/4452

Dear user,  
The last() function works with multiple entities or multiple attributes.  
In your case, I think you want to access the attribute "serialnr" inside the entity "dendro_visit". That entity must be marked as multiple. In that case, the expression should work properly.  
We will contact you to your private email address to better understand this issue.  
Many thanks,  
Open Foris Team
