cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cazzym
Helper I
Helper I

Model Driven App - Populating a Key-Value Multirow Table with a single form

Hello PowerApps community.

 

TL:DR - how do you have a form that populates a key-value table with multiple rows per form, with the keys taken from the rows of another table

 

I'm new to Model Driven Apps, so I have a basic question about how to set forms to work with a common DB arrangement. This is actually an app for COVID but that's both miserable and not something to share publicly, so let's just pretend this question is more humorously about animals at a farm.

 

We have a form where we fill in the information about a farm - including name, address, and a count of each type of animal by gender. There are a lot of different types of animals, and the animals we ask about may change from week to week.

 

Given this, rather than setting up a column in a table for each type of animal + gender combination, and changing it constantly, we'd rather pull from a table listing the current animals we are asking about, and ask the user the same question for each animal, storing it in key value pairs.

 

Here's how we have our dataverse tables

 

Animal Table - this table might change from week to week, and the animals asked about in the form should change appropriately.

AnimalDesc
Cow
Chicken
Donkey
Monkey

 

Farm Answer Table

FarmIdFarmNameFarmAddress
1Old MacDonald's FarmE i e i Road
2Wholesome Dairy IncorporatedBovine Crescent

 

Animal Answer Table

 

FarmIdAnimalMalesFemales
1Cow23
1Chicken45
1Donkey07
1Snake12
2Cow35
2Chicken47
2Donkey89
2Monkey00

 

Form

Farm Details  
Farm Name  
Farm Address  
   
Animal CountMaleFemale
Cow  
Chicken  
Donkey  
Monkey  

 

How do we implement a system like this, where the form fills in one row per farm, but multiple rows for each animal, and generates a field to fill in for each animal in the form?

0 REPLIES 0

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,684)