Cannot set file type in gui model

If I have a collection defined in application.alan:

'test': collection ['key'] {
	'key': text
	'file': file

Then when I define it in my custom gui model (model.alan inside the system folder):

'test': collection {
	'key': text
	'file': file

I get this error for the file type:

error: state constraint violation for 'expression'. Unexpected state for 'file name expression':
	- expected:  'yes'
	- but found: 'no'
		defined by /'test'/'file' of type 'application'!'ui file property'

A gui model requires an expression that determines the name for a file when a user downloads it. You can either provide that expression in your application.alan or in your model.alan file:

/* file: ./application.alan */
'file': file @name: .'key'

/* file: ./model.alan */
'file': file name: & :'key' // legacy syntax; to be updated
1 Like