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 / Retrieving Values from...
Power Apps
Answered

Retrieving Values from a gallery and adding them to a Form Datacard

(0) ShareShare
ReportReport
Posted on by 38

I want to take the start date from the first row of a gallery and the end date of the last row of a gallery and combine them into a Form data card. I also want to subtract end date of the last row from the start date of the first row to see how many days total.  Please see picture for clarification.

jselman_1-1660312335190.png

 

 

 

Thank you.

Categories:
  • Verified answer
    C-Papa Profile Picture
    1,836 on at

    Should be able to do something like this:

     

    Set the default property of the start date which is derived from the first gallery row to:

    First(Gallery1.AllItems).StartDate 

    you will need to change gallery1 to your gallery name and StartDate to your column \ date picker name. If its a date picker it will need .SelectedDate at the end

     

    And end date to:

    Last(Gallery1.AllItems).EndDate 

    you will need to change gallery1 to your gallery name and StartDate to your column \ date picker name. If its a date picker it will need .SelectedDate at the end

     

    then use DateDiff(EndDate,StartDate) to get the difference in days

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Travel Dates Text property: First(Gallery1.AllItems).StartDate & "-" & Last(Gallery1.AllItems).EndDate

    Total Travel Days: DateDiff(Last(Gallery1.AllItems).EndDate, First(Gallery1.AllItems).StartDate, Days)

  • jselman Profile Picture
    38 on at

    You are a rock star.  This worked perfectly.  Thank 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 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard