Using last-saved in Build

hello all right.. I saw that you have a lot of knowledge with the lest save option... I really need to implement this in my form, but I'm not an expert in XLSForm, so I build my forms in ODKBuil(online) and then download it normal in XML and I make manual changes in notepad, but trying to insert it in the Default Value field in ODKBuild in a question, this device does not work, I have already made several changes to this syntax, including following the example of https://docs.getodk.org but I it seems that the examples in there are all to be executed in XLSForm and not in the nocode tool that you have online.. would you know any solution for me..

Hi @BrunoAngelo ,

I saw your posts about last_saved. I am sorry I never used odk build. I will not be able to help you on that.
Anyway here is the xml line for my "user_name" text question, in the "utilisateur" group, using last-saved

value event="odk-instance-first-load" ref="/data/utilisateur/user_name" value="coalesce( instance('__last-saved')/data/utilisateur/user_name , /data/utilisateur/username )"/>
1 Like

thank you this was very useful.. but as it took a while to respond i had already managed it... and really by the odkbuild tool it is not possible just writing the line of code as you gave the example

I'll take a note to see whether there's an option in Build. Couldn't tell off the top of my head just now, sorry.

2 Likes

@BrunoAngelo Sorry it looks like last_saved is indeed not in the XForms spec, so support in ODK Build will only be possible once it has been introduced into the spec.

The most comfortable way to use last_saved will be to construct the form in Build, export to XLSForm, then add the last_saved where needed. For reference: how to use last_saved.