cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ywliang96
Level: Powered On

Hide Form According to User Input

problem zz.PNG

 

I'm currently have this form and I wish to apply a rule where if the user selected "No" in the dropdown button for "Are you currently in the location" then both Latitude and Longitude questions will hide and will appear if the user selects "Yes". Any solution for this?

 

 

 

 

 

zz1.PNG

 

 

 

zz1.PNGz1.PNG

10 REPLIES 10
Super User
Super User

Re: Hide Form According to User Input

@ywliang96 

Yes, it is possible to hide a Latitude and Longitude based on the response to "Are you currently in the location"?

 

Put the following code in the Visible property of both Latitude_User_DataCard1 and Longitude_User_DataCard1.

 

Switch(
    DataCardValue27.Selected.Value,
    "Yes", true,
    "No", false
);

I am somewhat unsure if this reference DataCardValue27.Selected.Value will work because you are using a combobox.  If .Value does not work type DataCardValue27.Selected. including the period and see what autocomplete suggests

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

ywliang96
Level: Powered On

Re: Hide Form According to User Input

Still does not work 

Super User
Super User

Re: Hide Form According to User Input

Can you please explain what happened when you tried? Did you use my code exactly and did you try something other than .Value? Was there an error.

A screenshot showing the code you entered would be best.
Community Support Team
Community Support Team

Re: Hide Form According to User Input

Hi @ywliang96 ,

 

Set below formulas to make this work:

Latitude_User_DataCard1.Visible=If(DataCardValue27.Selected.Value="No",false,true)
Longtitude_User_DataCard1.Visible=If(DataCardValue27.Selected.Value="No",false,true)

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ywliang96
Level: Powered On

Re: Hide Form According to User Input

I tried this formula and I gotten this error 

"We can't evaluate your formula because the values being compared in the formula aren't the same type"

Any ideas?

Super User
Super User

Re: Hide Form According to User Input

@ywliang96 

Can you please answer my questions I asked on Thursday?

 

"""

Can you please explain what happened when you tried? Did you use my code exactly and did you try something other than .Value? Was there an error.

A screenshot showing the code you entered would be best.  Even better if you can show me the autocomplete options.

"""

Highlighted
ywliang96
Level: Powered On

Re: Hide Form According to User Input

Here's is the error when I use your formula in the Latitude_User Visible Property

pp1.PNG

It gives me an error of the screenshot below

pp3.png

 

 

 

If i use this formula,

pp2.PNG

It gives me an error of the screenshot below

pp4.png

Super User
Super User

Re: Hide Form According to User Input

@ywliang96 
It appears you are using OptionSets in CDS. I have not worked with these before. Sorry, but this is not my area of expertise.

ywliang96
Level: Powered On

Re: Hide Form According to User Input

I tried with dropdown and it worked but if I tried with combobox, it does not worked. Any idea how to change from combobox to dropdown if my forms already pre-populated by PowerApps automatically?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,883)