Problem with ListBox & Upload document User input

Hi I have a page with a table view connect to a dataset (“AFFILIATI” set in read & write mode) and above the same fields (every input field linked to field database).
One field named “DOCUMENT LOADED” is a document type field; i have used a Upload field input to upload a field into database.
When i click on table view record, the fields above show and allow to edit the record, but if i have loaded a document , how I could show that there is a document loaded ?
Second question; in the table I have a reference field named “SPONSOR” linked to another table sponsor.
In the input form this works properly (the data set is set write only modality) → I must select the list value and press submit button to append new record to database.
But in the page with table view and input field, used to view and edit data , this field remain empty (don’t show the value of table view record selected)… any suggestion ?
Thanks
Fabio

Hi Fabio,
You can use Data Hooks to manipulate data before saving it to the database.
My suggestion is to add a boolean type field to your collection.
The function in the Hook should look like this:

export function yourCollectionName_beforeUpdate(item, context) {
	//TODO: write your code here...
	if (item.document) { // .document = field key name
		item.documentLoaded = true;
		return item;
	}
	return item;
}

Did you try to refresh your dataset and table ?
Check this out:

Good luck!

Hi Roi,

First :
Really, I would to know if there is a method to stored the URL of a document uploaded in a field of my collection (during form input action) to allìow my user to click and download it when (in other page) I show records of data base in data view object.

Second: do you have any suggestion for my second question ?

Thanks for your help