web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help on construting a ...
Power Apps
Answered

Help on construting a gallery or data table

(0) ShareShare
ReportReport
Posted on by 1,119

Dear All,

For a Castle management project, i require a help in constructing a gallery to generating a type of report.

I have sharepoint list in the below format.

Animal Name Animal Type DeliveryDate
Animal1 Cow 12/25/2020
Animal2 Cow 05/31/2021
Animal3 Cow 02/28/2022
Animal1 Cow 10/10/21
Animal2 Cow 06/02/22
Animal3 Cow 02/28/2022

 

With this above records, i would like to construct a gallery in the below format.

I am not sure how would i dynamically generate the delivery date column for each animal. So this shows for each year when the animal is delivering the calf and compare the data for further analysis.

 

Could any one give me idea please.

Animal Name Animal Type Delivery1 Delivery2 Delivery3
Animal1 Cow 12/25/2020 10/10/21 13/11/22
Animal2 Cow 05/31/2021 06/02/22  
Animal3 Cow 02/28/2022    
Categories:
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @venka91 ,

    Keep adding fields as required.

    AddColumns(
     GroupBy(
     YourDataSource,
     "Animal Name",
     "Animal Type",
     "Data"
     ),
     "Delivery1",
     Coalesce(
     First(Data).DeliveryDate
     ),
     "Delivery2",
     Coalesce(
     Index(
     Data,
     2
     ).DeliveryDate,
     Blank()
     ),
     "Delivery3",
     Coalesce(
     Index(
     Data,
     3
     ).DeliveryDate,
     Blank()
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • venka91 Profile Picture
    1,119 on at

    Thanks warren

     

    But in real time, i have come with different need when i started doing this.

    I have two sharepoint list as cow_master, calf_master

     

    we are updating the delivery details of cow in calf_master as birth date of calf. Meaning, when a cow gives a birth, 

    we add new record in calf master and specify the delivery date of cow as a birth date for the calf.

     

    So my requirement is, i want to show all the cow details in gallery. But the gallery should show the delivery date of each cow if my calf table has the entry with cow tag. the cow tag column exist in both cow table and calf table.

     

    when the cow gives birth, we add the new record in calf table and specify calfof column with mother cow tag number.

     

    hope my scenario is clear. could you please help. I am unable to get the desried result yet.

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @venka91 ,

    What is different now in the "main" list to the table you posted.

    Animal Name Animal Type DeliveryDate
    Animal1 Cow 12/25/2020
    Animal2 Cow 05/31/2021
    Animal3 Cow 02/28/2022
    Animal1 Cow 10/10/21
    Animal2 Cow 06/02/22
    Animal3 Cow 02/28/2022

    Are you saying the calf_master now has the last column ? I really need to understand your two lists and in particular the "key" field linking them as well as how and when records are created. You also cannot "dynamically" create columns - their names need to be hard-coded.

  • venka91 Profile Picture
    1,119 on at

    Hi Warren,

    Yes, the cow name is present in both cow_master and calf_master. Basically i would like to show all the cow_names from cow_master in the gallery.

     

    But the delivery date must be pulled from calf_master where the cow_name is matching. this calf_master has the delivery various dates for the cow.

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @venka91 ,

    What are the columns of calf_master including which is the "linking" field.

  • venka91 Profile Picture
    1,119 on at

    hi warran,

     

    my calf_master has the following columns

     

    mothercow_tag

    mothercow_name

    mothercow_dob

    mothercow_breed

    calf_tag

    calf_name

    calf_dob

    calf_breed

    calf_gender

    calf_status (choice colums [alive,dead,given away]

     

    when  a new calf is born, i will add the mother cow tag, its name and its dob and then its baby details.

    the mothercow_tag is present is common on cow_master and calf_master

     

    So now, i would like to show from for each mother cow, at what dates the calf is born.

    if the mothercow details not presnt in calf_table, this would show empty else it would show calf delivery dates.

  • Verified answer
    WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    HI @venka91 ,

    You will need to add if more than 3 dates are required.

    With(
     {
     wCalves: 
    	 AddColumns(
     cow_master,
     "CalfList",
     Filter(
     calf_list As aCalf,
     aCalf.mothercow_tag = mothercow_tag
     )
     )
     },
     AddColumns(
     wCalves,
     "Delivery1",
     First(CalfList).DeliveryDate,
     "Delivery2",
     Index(
     CalfList,
     2
     ).DeliveryDate,
     "Delivery3",
     Index(
     CalfList,
     3
     ).DeliveryDate
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • venka91 Profile Picture
    1,119 on at

    Thanks @WarrenBelz , this is working perfectly. I have customized accordingly based on my requirement. Many thanks for the idea provided. I am just wondering the ability of powerapps to make any kind of custom galleries by seeing your deep thinking methods.  Sorry, but the last, i would like to build one more complex custom design gallery which i would post in another forum. 

    Kudos to you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard