web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display Text based on ...
Power Apps
Answered

Display Text based on User input in form

(0) ShareShare
ReportReport
Posted on by 18

I have a specific requirement where I Field called Country in Form.New and based on the User Input a Text should display.

 

For example 

If the user Typed Country Kuwait , a text will display the Population "4 Million"

 

I have tried the below but if gives error 

If(
DataCardValue12.Text = "Kuwait", "3 Million",
)

 

Regards,

Abbas

Categories:
  • Verified answer
    AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @abbaschopra,

     

    I believe your code does not work because you have a comma before the closing bracket.

     

    An alternative to the IF statement is to use the Switch statement

     

    Switch(DataCardValue12.Text, 
     "Kuwait", "3 million",
     "Country 2", "4 million",
     "Country 3", "5 million"
    )

     

    .

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • abbaschopra Profile Picture
    18 on at

    @AARON_C ,

     

    Thank you for the reply,

     

    I had not noticed that and the thank for suggesting the switch Function , So my requirement its best solution instead of using IF and the code becomes big.

     

    Regards,

    Abbas

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard