Returning field value in the query of image field


I believe it is an easy question but I am stuck on this. How could I get something that would produce this?

		query:  site.find(fields.project.value).images

in this:

		label: 'Select a Subpage'
		type: pages
		query: site.find('Home')
		max: 1
		label: 'Image or Video'
		type: files
		query:  site.find(fields.project.value).images

I’ve been exploring the doc and couldn’t find that but I believe I just haven’t found it… haha

Thanks a lot!

This won’t work as expected, because 1) the syntax is wrong, and 2) you cannot get the value of the first field on the fly (i.e. when the value of the pages field changes).

Syntax would have to be

query:  site.find(page.project.toPage).images

This might show an error if there is no page selected (and saved) yet.