Cannot retrieve items in List control after using files uploaded

Hi,

Have been using the following on a list control in one of my forms:

//log all uploaded files to console
fd.control('SPDataTable0').$on('filesUploaded',
function(itemIds) {
itemIds.forEach(function(item) {
console.log(item);
});
});

This is from the Javascript section of the Docs. The instructions say that this works in List or Library control, however it does not appear to return anything if I add a list item. Should the notes be updated to say Library control only? Or am I doing something wrong.

My list control is not bound to the parent form, as I want to use filtering to dynamically change the items shown, however I do need to be able to update new items after they have been added.

Hello @abolam,

You can dynamically filter records in 'List or Library' control based on field values. Please see the 'Filtering List or Library by CAML' article with examples.

You can find the example of updating items in another list in the 'Update uploaded files (List or Library)' article.
The difference for the list is that instead of 'filesUploaded' event, you need to use the 'change' method. Please see the 'List or library controls' documentation for more details.

As an option, you can pass value from the parent form to child before item creation, if the child item opened in the dialog.

For this please follow the below steps:

  • Please define fd globally in the parent Form by pasting the code window.fd = fd; in Javascript Editor;
    image

  • Please paste the below code in Javascript Editor in the child Form. Replace filed names in the code with the internal names of the field from your form.

fd.spRendered(function() {
    //Set field value with the value from the parent on form load
    fd.field('ChildFieldInternalName').value = window.top.fd.field('ParentFieldInternalName').value;

});

Please find more detailed instruction on populating fields in a dialog in the 'Passing values from a parent form to a child opened in a dialog' article.