cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Visible if dropdown2 less than dropdown1

HiAll,

 

Frustrated of Fareham here with another question 😀

I have a Start hour dropdown and an End hour dropdown. I want to prevent the user entering an end time that is before the start time (I know - they're idiots aren't they). No idea how to do this with validation, so I tried just having a red text label pop up if it was using: 

If(HourDropdown_2.Selected.Value <= HourDropdown_1.Selected.Value,true,false)

HourDropdown_2 is End time and HourDropdown_1 is Start time.

But it doesn't work 😏

 

Screenshot 2019-12-03 at 11.28.55.png

 

Is there a way of doing some kind of value validation on the actual dropdown? If not, any idea why my formula doesn't work - It's usually because I have ) or ( or , or . in the wrong place or used '.Value' when it should be something else. But believe me I have tried lots of different ways without success. Is it because the Data type is text?

 

A second issue I will mention while we're on the subject of time: How do you stop the user selecting a date in the future on a DatePicker dropdown?

 

Kev

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver I
Resolver I

Re: Visible if dropdown2 less than dropdown1

Hi @mdevaney 

 

I managed to work it out for myself eventually 😀

If(Value(HourDropdown_2.Selected.Value) <= Value(HourDropdown_1.Selected.Value), true, false)

 

Thanks for your help! And I'll definitely check out the link you gave me.

 

Kev

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Visible if dropdown2 less than dropdown1

@KevinHardy 

There are many questions in this post.  Lets resolve your issue shown in the screenshot first.

 

It looks like there is no column called Value for the data used in your Items property.  Can you please type this code into the formula bar and wait to see what appears in the autoselect menu?  Likely there is some different name than Value.

HourDropdown_2.Selected.

 

Now for your 2nd question "how do you stop the user selecting a date in the future on a DatePicker dropdown?"  There is currently no way to restrict dates in the DatePicker by changing a property.  In my humble opinion this is one the areas in PowerApps needing immediate attention.  For a workaround check out this blog by April Dunham (SharePoint Siren).  I saw her speaking live at MS Ignite this year and the talk she gave was pretty excellent.  You can trust her to give you good advice.

 

Link To April's website

https://www.sharepointsiren.com/2019/05/powerapps-restricting-date-picker-options/

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

Highlighted
Resolver I
Resolver I

Re: Visible if dropdown2 less than dropdown1

Hi @mdevaney 

 

Screenshot 2019-12-03 at 12.40.33.png

You're right. There is no column called Value - which explains why I'm always having trouble like this as I hadn't realised it needed to be that 🙄

However, it does only offer Value as an option.

The columns in Sharepoint are actually StartTime and EndTime and I have dropdowns for both Hour and Minutes which I then join in a label to update the list with:

Time(Value(HourDropdown_1.Selected.Value), Value(MinutesDropdown_1.Selected.Value), 0)

 

Kev

Highlighted
Resolver I
Resolver I

Re: Visible if dropdown2 less than dropdown1

Hi @mdevaney 

 

I managed to work it out for myself eventually 😀

If(Value(HourDropdown_2.Selected.Value) <= Value(HourDropdown_1.Selected.Value), true, false)

 

Thanks for your help! And I'll definitely check out the link you gave me.

 

Kev

View solution in original post

Highlighted
Super User III
Super User III

Re: Visible if dropdown2 less than dropdown1

@KevinHardy 

It appears your Dropdown was holding text values for some odd reason.  That's why putting the reference inside VALUE was necessary.

 

Please remember to close the thread if the issue is now resolved.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Resolver I
Resolver I

Re: Visible if dropdown2 less than dropdown1

Hi @mdevaney 

 

I've had a look to see why it it a text value. I think it's because the Sharepoint columns are SIngle Line Text rather than Number. I will try to remember to get this right in future 😀

 

Thanks again for your help

 

Kev

Highlighted
Super User III
Super User III

Re: Visible if dropdown2 less than dropdown1

@KevinHardy 

Yup, wrong SharePoint column type: that would do it.  Best of luck in building your app!  

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,926)