If you want to create a record with its child records in Power Pages, there is no way to do it using out of the box forms. But you can do it using JavaScript Power Pages Web API, and with a single Web API call.
In this blog post we will use the example of creating an Account with 2 child Contacts in Power Pages.
Prerequisites
- Enable both the Account and Contact tables for the WebAPI
- Enable the fields used in the WebAPI call for both tables (including the relationship field)
- Configure proper table permissions for both tables (so users can create items and associate contacts with accounts)
- Include the ‘WebAPI’ wrapper (sample from Microsoft) in a web template so you can use the webApi.safeAjax function as below
How to setup the request
In your JavaScript code, define a variable or constant with the object you want to submit.
This needs to contain all the fields from the parent object (account) and the array of child objects (contacts) under a property with the…
Source link
More About This Author

-
SharePoint and Office 365 Consultant/Developer always trying to get the best from Microsoft stack (Microsoft 365/Azure/Power Platform and related stuff).
Living in Ireland since 2018, I had previously worked in Brazil as a consultant/developer for Office 365, SharePoint and related technologies for almost 10 years.
Array
Modern Workplace19 November 2023Ignite 2023: Curated blog posts with Microsoft 365 & Power Platform Updates
Modern Workplace4 November 2023Getting the proper SharePoint list columns internal names to use in List Formatting JSON
Modern Workplace25 October 2023Create parent and child records with a single WebAPI call in Power Pages
Modern Workplace21 October 2023How to allow users to only Add and View SharePoint list items (block editing/deleting)