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 / Power Apps and SQL - m...
Power Apps
Answered

Power Apps and SQL - make text field visible based on drop-down selection

(0) ShareShare
ReportReport
Posted on by 21

I have a SQL table that has two rows in it which are choice options for a drop-down list in a fairly huge SQL database.  I'm also using that table in a Power Apps application I'm creating which is meant to add records to that database. The data type in SQL of the column I'm referencing is varchar.

In the PA application I created a drop-down list which shows the column from the SQL table. In PA it says the the data type is Text. I want some input text fields in PA to be visible or not depending on which value the user chooses in the PA drop-down list.

If they choose "Person", fields for first, middle and last name should appear. If they choose "Organization", one text field will appear for the organization name.

On the "Visible" property of the PAs person text fields I used the formula:

If(drpPartyType.Selected.Value = "Person", true, false)

I would use similar logic if "Organization" was chosen, the other text input field would appear.

drpPartyType is the drop-down in PA.

When I put the formula in, PA it's telling me it doesn't like the word "Value" (it has the red underline).

The message reads:

Name isn't valid. 'Value' isn't recognized. Incompatible types for comparison. These types can't be compared: Error, Text.

I'm not sure if the issue is the word "Value" or what. I've tried a few different solutions but haven't had any luck. Any assistance would be greatly appreciated.

Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
    HI,
     
    I am trying to weed through this, but it would help immensely if you would use pictures for UI's and mark them up, versus trying to describe them as then we have to try to piece it together ourselves, which takes time.
     
    Thank you for the error picture, for future ones, love the error info, but if you can also share a pick so we can see the squiggles sometimes it helps us. (ok maybe just me lol)
     
    1. Can you please show me the Items property of drpPartyType
    2. Can you change it to .SelectedText.Value (I want to see if you get the same error)
    3. I know you said its a dropdown but is it for sure a DropDown or a ComboBox just verifying
    4. Once you show whats in the DP/CB Items property
     
    You may find that you bound an Object. If you did, then you should have to do something like this
     
     
    drpPartyType.ObjectName.Attribute
     
    So if I bound a Collection and then i set the "visible field" as Title in the dropdown you would see title. but .Selected would not just be a Value Text it would be an Object, that you have to use Dot Notation on to get to the field/attribute you want
     
    Make sense?
  • ML-07031739-0 Profile Picture
    21 on at
    Hi Michael:
    First, thank you for responding.  I'm attaching screenshots of the drop-down properties and the error messages.  The first one is the original, the second is based on your #2 request and the third is my attempt at what you tried to explain about having a bound object.  I believe I understood your instruction, but maybe I got it wrong.
     
    Unfortunately, none of these worked.  Maybe you can see something in the screenshots that will help.
     
    Again, thank you.
    -Mark
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
     
    Sorry I should have been clearer so let me ask this.
     
    When you type in drpPartyType.Selected. do you actually see only Value, or do you see things like Description etc, (where .Selected is actually the instance of CftPartyType), which is its a collection is what I would expect.
    • So, I am really curious what CftPartyType is, is that a Collection, Choice column (single or multi-select)?
    • If you could show me the format of that as well as 
     
    • Here is an example. Here I have a dropdown that I bound to a Table (of people). The Table has one field in it called who (yeap I'm a master namer lol)
      • You see here, when I type .Selected. i then go to who, the property of the current record in the Table I selected in the drop down.
    Dropdown5.Selected.who.Email
     
    If I type .Value it will give me red squiggles like you.
     
    Thats why I believe yours is a collection/object and you just need to do .Selected.property etc. Now property could be another object (like a lookup to another list or something and you just keep going . (dot notation) to get to the property you want to compare
     
     
     
     
  • Verified answer
    ML-07031739-0 Profile Picture
    21 on at
     
    Thank you so much Michael!
     
    When I went back and looked at what PA was providing after typing "Selected." I realized I should have chosen the Description field from the table I was referencing.  Things are now working as desired.  I feel slightly foolish for not figuring this out on my own.  Your questions got me to the answer.
     
    Again, thank you very much!
    -Mark

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