cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Child Form within Parent Record Form

In PowerApps portals is there a way to include a child record form within the parent record and pass it parameters? not as a subgrid but more like an ASP.Net Repeater?

 

For example, my issue is I have an Application entity with multiple child Projects and the customer should be able to add child attributes (Costs and Funding) to the Project

 

Parent EntityChild Entity Relationship
ApplicationProject1..N
ProjectCosts1..N
ProjectFunding1..N

 

I have set up the following forms

  • Application - includes subgrid of Projects
  • Project Costs - simple form with only a subgrid of Project Costs
  • Project Funding - simple form with only a subgrid of Project Funding

I have tried to make the user navigate from the Application to the child Project and add the Costs and Funding but the journey isnt great as they need to remember to navigate back to the application at the end of the process.

 

I then tried adding actions to the project subgrid (Edit Action (Add project costs) - renders Project Costs entity form, and similar for Funding). The problem with this is that it renders the Costs and Funding grids within a dialog which then when I click Add renders the Add form within a dialog in the dialog. 

 

Neither option is a good experience.

 

Is there a way to use {% entityform %} but to pass in an ID so that I can emulate the asp.net repeater like the example below

 

 

{% for project in appProjects.results.entities %}
    {% entityform "projects - costs" | id = project.Id %}
{% endfor %}

 

 

 

 

 

1 REPLY 1
Highlighted

Re: Child Form within Parent Record Form

I am trying to wrap my head around the data model and your approach, so I might make some assumptions.

 

I think (and I might be wrong) is that you are depending on opening the "pop up" modal entity forms when it might make more sense to instead, from the entity list, open a new web page with an entity form.  The users would still need to navigate, but if done correctly could lead them along properly to add/edit info without getting lost.

 

Here is how I would do it;

 

You have a web page with the application entity form, which has a subgrid of projects.

The user can add or edit a project from the subgrid, but instead of a opening a modal entity form, I would recommend opening up this form on a whole new web page with a entity form for projects (you can configure this from the sub-grid options).  The submit process for the project form should redirect back to the application.

The project form (web page) can have the 2 subgrids, one for project costs, one for project funding.  From here, the add/edit for each subgrid could then open a modal entity form, and click OK would bring you back to the project page with the two entity lists. 

If a user clicks OK/Submit on the project form page, you need configure it to redirect back to the application page/form instead of just showing a success message.

 

If you want to eliminate all the page opening and redirection, because you are writing to multiple entities, that approach would require custom code, such as a custom HTML form and submitting data back to CDS via a companion app.  I have done this using an custom HTML form and a Power Automate http request, which updates multiple entities, but you have potential security issues.

 

I hope this helps!

 

Cheers

Nick

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (6,529)