Getting started
User guide
- Settings
- Form sets
- Containers
- Controls
- SharePoint fields
- Common fields
- JavaScript
- CSS
- SharePoint form panel
- SharePoint web parts
- Microsoft Teams tab
- Forms versioning
Provisioning forms
Examples
- Ticket management system
- Dynamic form for a user group
- Conference room reservation system
- Discussion within a SharePoint form
- Version history within a SharePoint form
- Organize related docs in libraries and folders
- Duplicate item button for List or Library
- Move new form page to another location
General
- YouTube
- Licensing
- Manage subscription
- Billing and payments
- Privacy policy
- Data protection and security
- Version history (Microsoft 365)
- Version history (SharePoint 2019/SE)
Multilingual support
Navigation between forms
- Generate a link to a SharePoint form
- Redirect user after form submission
- Open edit form by default for a user group
- Open form in a dialog
Generating PDF documents
- Save SharePoint form as PDF
- Generate PDF from DOCX template with Plumsail Processes
- Generate PDF from DOCX template with Word Online (Business)
Integration with Power Automate
How to retrieve field values of SharePoint form from another form opened in dialog
In this article, you will find the instructions for passing values from a parent form to a child form, which is opened in the dialog box.
Suppose that a company possesses a set of facilities and requires a facility management system. In case of any problem at a facility, a user creates an issue in this system. This issue is assigned to a specific manager who is responsible for this facility. Each issue can have several tasks.
Facilities list will only store the information about facilities and their managers: Title and Manager fields only. Issues list will be the parent list for the Tasks list.
To speed up the task creation, we will set up prepopulation of the necessary information from a parent form, e.g. ‘Facility’, ‘Priority’, and ‘Assigned to’.
Parent form
Here is a simple Issue form containing all the fields from the Issues list plus a ‘List or Library’ control bound to the Tasks list and displaying issue’s tasks.
To be able to pass values from a parent form to a child form, we need to define fd globally in the parent form with the code:
window.fd = fd;
Since each facility has a manager, we’ll populate the Manager field, when the Facility changes. To do this, we will add the following code into JavaScript editor:
window.fd = fd;
fd.spRendered(() => {
fd.field('Facility').$on('change', value => {
fd.field('Manager').value = value.Manager.EMail;
});
});
Child form
Here is a form of the Tasks list:
Here we will populate Priority, Facility (lookup field), and Assigned To fields with values from the parent form.
To get access to the parent form’s fields, we will use ‘window.top’ property which returns the topmost window object. This code will get values from parent form:
fd.spRendered(() => {
const parentForm = window.parent.fd;
if (parentForm) {
// set field values with the values from the parent on form load
fd.field('Facility').value = parentForm.field('Facility').value.ID;
fd.field('Priority').value = parentForm.field('Priority').value;
fd.field('AssignedTo').value = parentForm.field('Manager').value;
// disable Location field
fd.field('Facility').disabled = true;
}
});