cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ArafatTehsin Helper III
Helper III

Update Drop Down in Component

Hi folks! (esp. @v-siky-msft)

 

As you know that we lack a simplest control of all time i.e. Time Picker control in our Power Apps and I am thinking to build my own (very basic one).

 

I have got 2 drop downs (Hours and Minutes) with each of their item values set up to 00 ... 23 and 00 ... 59 respectively. 

 

I have created a Component. Inserted these two drop downs there; created two more Input Properties called Hours and Minutes. 

 

If I Hours property of my component to let's say 03 then the Hours Drop Down within my component should get changed as well. 

 

How can I bind this? 

 

Thanks

Arafat

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Update Drop Down in Component

Hi @ArafatTehsin ,

Do you want to change component  Input Property to change the selection value in the drop down?

If so, I've made a similar test for your reference:

1)inside the compoment

create two input properties:

3313.PNG

 

3314.PNG

 set the component's OnRest:

Set(var1,Component1.sethour);Set(var2,Component1.setminute)

3315.PNG

 

set drop down1's Defaults: var1

 

set drop down2's Defaults: var2

 

2)Then in app, insert this component.

If you change the value of sethour property, the hour drop down's selected value will change.

If you change the value of setminute property, the minute drop down's selected value will change.

331.gif

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support
Community Support

Re: Update Drop Down in Component

Hi @ArafatTehsin ,

Do you want to set the component's custom property based on the selections of the drop downs inside the component?

If so, I've made a similar test for your reference:

1)inside the component

insert two drop downs

drop down1 represents Hour, set its Items:

[0,1,2,3,4,5,....21,22,23]

drop down2 represents Minutes, set its Items:

 

[0,1,2,3,4,5,...,58,59]

 

2)create two custom properties for this component

3278.PNG

 

3279.PNG

 

3)set these two properties:

Hours

Dropdown1.Selected.Value

Minutes

Dropdown2.Selected.Value

3270.PNG

 

4)Then in the app, you could use this formula to represent the selected hour in hour drop:

Component1_1.Hours

//Component1_1 is my component name.

You could use this formula to represent the selected minute in hour drop:

Component1_1.Minutes

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ArafatTehsin Helper III
Helper III

Re: Update Drop Down in Component

Hi @v-yutliu-msft 

 

Thank you for your response but it only gives me an output (get). I also want to set the values of Drop Down in the component. 

 

In short, how can I update the values of Drop Down inside the component using Input Property. 

 

Cheers

Arafat

Community Support
Community Support

Re: Update Drop Down in Component

Hi @ArafatTehsin ,

Do you want to change component  Input Property to change the selection value in the drop down?

If so, I've made a similar test for your reference:

1)inside the compoment

create two input properties:

3313.PNG

 

3314.PNG

 set the component's OnRest:

Set(var1,Component1.sethour);Set(var2,Component1.setminute)

3315.PNG

 

set drop down1's Defaults: var1

 

set drop down2's Defaults: var2

 

2)Then in app, insert this component.

If you change the value of sethour property, the hour drop down's selected value will change.

If you change the value of setminute property, the minute drop down's selected value will change.

331.gif

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

ArafatTehsin Helper III
Helper III

Re: Update Drop Down in Component

Cheers @v-yutliu-msft 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (1,912)