cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Text displayed based on dropdown selected

Hello, 

 

Is it better to use a Dropdown control with the following formula: 

Distinct(
    Filter(
        projectList,
        projNum = projNum.Selected.Value),
        project_description)

 

Or a Textbox control with the following formula: 

First(
    Filter(
        projectList,
        projNum = projNum.Selected.Value
    )
).project_description

 

I stumbed upon the Dropdown trick when faced with  the "This item expects Text values but produces incompatible Table values" error a few months ago and just stuck with it. 

 

Some cons I found are: 

  • You have to set the ChevronBackground and ChevronFill to RGBA(0,0,0,0) to make the control look like a Textbox
  • The Chevron area still takes up space in the visible area and text can be truncated. 

I just don't understand the Textbox formula shown above. The .dot notation at the end throws me off. Am I doing it correctly or is there (yet) another way to display text in a Textbox based on the choice from another control?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: Text displayed based on dropdown selected

Hi @ericonline

 

There is no such thing as a Textbox control, do you mean a Label or a Text input?

1.JPG

 

Next, the answer depends on whether you just want to display the text or you want the user to provide input.

 

If just to display text, then use a label with the following:

 

LookUp(
    projectList,
    projNum = projNum.Selected.Value,
    project_description )

 

 

PS To clarify how this works, Filter always returns a table (incl. an empty table if no matches are found or a single row if only one match, but it is still a table), whereas LookUp always returns a record (if multiple records match then only the first one is returned) hence LookUp() is the same as First(Filter()) 

View solution in original post

2 REPLIES 2
Meneghino
Level 10

Re: Text displayed based on dropdown selected

Hi @ericonline

 

There is no such thing as a Textbox control, do you mean a Label or a Text input?

1.JPG

 

Next, the answer depends on whether you just want to display the text or you want the user to provide input.

 

If just to display text, then use a label with the following:

 

LookUp(
    projectList,
    projNum = projNum.Selected.Value,
    project_description )

 

 

PS To clarify how this works, Filter always returns a table (incl. an empty table if no matches are found or a single row if only one match, but it is still a table), whereas LookUp always returns a record (if multiple records match then only the first one is returned) hence LookUp() is the same as First(Filter()) 

View solution in original post

Super User
Super User

Re: Text displayed based on dropdown selected

Thank you very much @Meneghino

 

Yes, "Text Inpuf" control. 

 

Understood. I see that I was using Filter in an unusual way. Will use the Lookup method as you show. 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,317)