cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chairman_Mau
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

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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

MPP IDEAS

Ideas

Discover ideas and concepts from users like you for how to use Power Pages and take your work to the next level.

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Users online (2,481)