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

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
Highlighted
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."

Highlighted
Helper II
Helper II

Re: Hide Form According to User Input

Still does not work 

Highlighted
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.
Highlighted
Community Support
Community Support

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.
Highlighted
Helper II
Helper II

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?

Highlighted
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
Helper II
Helper II

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

Highlighted
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.

Highlighted
Helper II
Helper II

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,932)