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 / DropDown time items
Power Apps
Unanswered

DropDown time items

(0) ShareShare
ReportReport
Posted on by

Hello i have two drop down boxes having various times of the day. e.g. 6:00 AM, 6:30 AM, 7:00 AM, 7:30 AM...

 

I would like that when I choose the first drop down e.g. 8:30 AM the second drop down automatically add 8 hours to the second drop down box. e.g., if I choose 8:30 AM on the first dropdown the second drop down automatically adds 8 hours to the time and becomes 4:30 PM.

 

The drop down is structured as below, an assist on this would be great. Thank you

 

9.PNG

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on at

    Hi @TYNAI ,

     

    I made a sample for you.

    vxiaochenmsft_0-1668664636326.png

    vxiaochenmsft_1-1668664650504.png

    vxiaochenmsft_2-1668664663344.png

    Text(DateAdd( DateTimeValue("2022-10-5 "&Dropdown1.Selected.Value),8,Hours),DateTimeFormat.ShortTime)

     

    Best Regards,

    Wearsky

  • TYNAI Profile Picture
    on at

    Hello @v-xiaochen-msft ,

     

    Thank you the code works! only two issues

    1) What is the purpose of the "2022-10-5" in the code.

    2) It seems once you use that code on the second drop down, the user not able to choose another time apart from the default + 8 hours e.g dropdown 1 is 8:30 AM, by default it will add 8 hours which is 4:30 PM but if you try selecting 5:00 PM on drop down 2, it default back to 4:30 PM, 

  • v-xiaochen-msft Profile Picture
    on at

    Hi @TYNAI ,

     

    First question:

    Because the datetimevaule() function requires a datetime parameter, so I add a date like '2022-10-5'. You can use any date here. 

    Second question:

    It's by design. The second dropdown will show its default value when you reset it. Since it has the value of the first drop-down in its default property, the reset event is triggered when you change the option of the first drop-down.

     

    Best Regards,

    Wearsky

  • TYNAI Profile Picture
    on at

    Hi @v-xiaochen-msft ,

     

    Thank you for your fast reply,

     

    i understand the first answer, thank you.

     

    What if for the second drop down i wanted users also to be able to choose other timings apart from the default calculated 8 hours? maybe a user can be able to choose 2:00 PM or 6:00 PM, but the drop down still hold the default calculated 8 hours when the user decided not to change the timings for that particular day i.e incase he forgets or its a regualar day... by the way this is a timesheet kind of APP

     

     

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
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard