cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SKH19
Level 8

Model-driven App Auto-fill Sub-grid on New

I have 2 related entities, Employee and Medical. Medical contains the same 8 Medical records for each employee, with each one having different values. For example, there is Medical 1, Medical 2... Medical 8 and each one has Active or Inactive in one field, Date Tested on another field, etc. That's a simplified version, but the idea is there. I have Medical set up as a sub grid of the Employee view, so you can see the values for each of the 8 Medical records for that employee.

 

The problem is on creating a new Employee record. The user has to manually fill out the 8 names of Medical records, which means there could be mistakes. When creating a new Employee record, I want the Medical entity to automatically populate 8 records for that new Employee with the 8 Medical Names, so that the user just has to enter the values for the other fields. 

 

Does that make sense? I was thinking maybe a Business Process Flow for new Employee records that has a Flow step that populates the Medical record. Is that too complicated? Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Model-driven App Auto-fill Sub-grid on New

Hi @SKH19 ,

Could you please share a bit more about your scenario?

Do you want to auto-populate 8 records for that new Employee with the 8 Medical Names?

 

If you want to auto-populate 8 records for that new Employee with the 8 Medical Names, when you add a new Employee record in your Model-Driven app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Based on the needs that you mentioned, I afraid that the Business Process Flow also could not achieve your needs directly. As an alternative solution, I think the MS Flow (Microsoft Flow) could achieve your needs.

Note: Business Process Flow could not relate the new created Employee record with the 8 Medical records.

 

I have made a test on my side, please take a try with the following workaround (I add three parallel branch actions in following flow, on your side, you could add more parallel branch actions😞

8.JPG

 

9.JPG

 Note: I assume you have set up a Relationship between your Employee Entity and Medical Entity, Employee Entity has a 1:N relationship with your Medical Entity.

 

When a new Employee record is created in your Employee Entity, above flow would be fired, then create 8 Medical records in your Medical Entity. And then, you could edit your employee field, then complete the rest field values for each Medical record within the Sub-grid in your Model-Driven form.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Model-driven App Auto-fill Sub-grid on New

Hi @SKH19 ,

Could you please share a bit more about your scenario?

Do you want to auto-populate 8 records for that new Employee with the 8 Medical Names?

 

If you want to auto-populate 8 records for that new Employee with the 8 Medical Names, when you add a new Employee record in your Model-Driven app, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Based on the needs that you mentioned, I afraid that the Business Process Flow also could not achieve your needs directly. As an alternative solution, I think the MS Flow (Microsoft Flow) could achieve your needs.

Note: Business Process Flow could not relate the new created Employee record with the 8 Medical records.

 

I have made a test on my side, please take a try with the following workaround (I add three parallel branch actions in following flow, on your side, you could add more parallel branch actions😞

8.JPG

 

9.JPG

 Note: I assume you have set up a Relationship between your Employee Entity and Medical Entity, Employee Entity has a 1:N relationship with your Medical Entity.

 

When a new Employee record is created in your Employee Entity, above flow would be fired, then create 8 Medical records in your Medical Entity. And then, you could edit your employee field, then complete the rest field values for each Medical record within the Sub-grid in your Model-Driven form.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
SKH19
Level 8

Re: Model-driven App Auto-fill Sub-grid on New

@v-xida-msft 

 

I am putting this solution together now and will see if it works.

 

The reason I was thinking we would need a Business Process Flow is that in order for the Flow to trigger, a new Employee record needs to be created and saved, correct? This means that, when creating a new Employee record, the tab for Medical will still be empty until the user saves the record.

Could I set it up so that the Medical tab is not visible on creation of a new Employee record? Or am I correct in thinking we need a BPF that forces the user to save the Employee details before going on to enter Medical information, which at that point will be populated with the 8 correct names?

Community Support Team
Community Support Team

Re: Model-driven App Auto-fill Sub-grid on New

Hi @SKH19 ,

Based on the needs that you mentioned, I think the MS Flow is enough for your scenario, you do not need to add a Business Process Flow to trigger the ms flow.

 

The ms flow solution I provided above would be fired when a new Employee record is created in your Employee Entity. On your side, you could consider enter Employee info in your Model-Driven form, and then save it, then the ms flow would be fired automatically. You do not need to fire the flow manually from your Business Process Flow (It is not necessary to set up a Business Process Flow).

 

Please consider take a try with above MS Flow solution I provided, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SKH19
Level 8

Re: Model-driven App Auto-fill Sub-grid on New

Yes, it totally works for populating the name field of the 8 records I need, thank you.

 

The only issue is that if, when filling out a new Employee form, the user clicks on the Medical tab then that tab will be empty and perhaps a little confusing. I'm looking into using JavaScript to hide the tab on a new form until a new employee record has been created and saved.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,900)