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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default Value for Time
Power Apps
Answered

Default Value for Time

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

I have a table in dataverse with various columns including a column called 'Date'.

 

I have made a canvas app which has two screens - the first screen has a gallery which has an overview of some important columns, When a column in the row is clicked it opens screen two which populates textboxes and combo boxes with the data of the selected row.

 

This works fine however I have a problem with the 'Date' column. I would like to display the time from the gallery in combo boxes. 

 

I have tried 

 

Gallery1.Selected.Date

 

in the Default field of the hours and minutes combo boxes but this just gives me 00:00.

 

Can anyone help?

 

Thanks 

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @AshleyTaylor,

     

    You can use the following code for the comboboxes:

    //Hours combobox
    
    //Items property (display hours starting from 00 until 23)
    ForAll(
     Sequence(24),
     Text(
     Value - 1,
     "00"
     )
    )
    
    //DefaultSelectedItems property
    //In case of a dropdown this would be Text(Hour(Gallery1.Selected.Date),"00") in the Default property
    [Text(Hour(Gallery1.Selected.Date),"00")]

     

    //Minutes combobox
    
    //Items property (display minutes starting from 00 until 59)
    ForAll(
     Sequence(60),
     Text(
     Value - 1,
     "00"
     )
    )
    
    //DefaultSelectedItems property
    //In case of a dropdown this would be Text(Minute(Gallery1.Selected.Date),"00") in the Default property
    [Text(Minute(Gallery1.Selected.Date),"00")]

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 428

#2
WarrenBelz Profile Picture

WarrenBelz 374 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 333 Super User 2025 Season 2

Last 30 days Overall leaderboard