cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hasankmurad
Level: Power Up

Based on a choice, speicific text field should appear

Greetings,

 

i have an inventory powerapp linked to a form which the data source of is a sharepoint online list. what i'm trying to achieve is that based on  a choice field selection, a text field must show or hide.

 

_____________________________

 

Brief explanation:

  1. Asset Type (Choice) : Node, Server, UPS, Storage, Chasis, Patch Panel
  2. Management IP (Single Line of text)

 

what i need to achieve is that when the choices Node, Server, or Storage are selected from the drop down in the powerapp, the management IP text field should appear. However when UPS, Chasis, or Patch Panel are selected, the management IP text field should be hidden.

 

Note that:

  • In "Management IP", the visible is set to showMgmtIP.
  • In "Asset Type", the OnChange is set as below currently

_______________________________________________________________________

If (
    DataCardValue10.Selected.Value = "Nodes" || "Server" || "Network Switch" || "Storage" ||"Appliance" || "SAN Switch" || "Chasis",
    Set(
        showMgmtIP,
        true
    ),
    Set(
        showMgmtIP,
        false
    )
)

_______________________________________________________________

I was successful when i treid to achieve this based on a single choice. for example, if i want management IP to show only if node is seletected, i used the code below and i was successful:

 

If (
    DataCardValue10.Selected.Value = "Nodes" ,
    Set(
        showMgmtIP,
        true
    ),
    Set(
        showMgmtIP,
        false
    )
)

____________________________________________________________

 

I need assistance ASAP!!!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Based on a choice, speicific text field should appear

Hi @Hasankmurad 

As per your snippet, it is considering each option as a condition, maybe that's why it is not working. Please use the below expression:
If (
    DataCardValue10.Selected.Value in ["Nodes", "Server","Network Switch","Storage","Appliance","SAN Switch","Chasis"],
    Set(
        showMgmtIP,
        true
    ),
    Set(
        showMgmtIP,
        false
    )
)
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Based on a choice, speicific text field should appear

Hi @Hasankmurad 

As per your snippet, it is considering each option as a condition, maybe that's why it is not working. Please use the below expression:
If (
    DataCardValue10.Selected.Value in ["Nodes", "Server","Network Switch","Storage","Appliance","SAN Switch","Chasis"],
    Set(
        showMgmtIP,
        true
    ),
    Set(
        showMgmtIP,
        false
    )
)
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Hasankmurad
Level: Power Up

Re: Based on a choice, speicific text field should appear

For some reason, I am not able to select anything from the drop down list. once this code was applied, the items in the list seems to have disappeared.. would appreciate your assistances

Dual Super User
Dual Super User

Re: Based on a choice, speicific text field should appear

@Hasankmurad 

 

Can you please a screenshot of your screen arrangement? 
 
Also, please verify the items property of your Dropdown control, if you have used the Distinct function, please check if you are referring to correct column name, Distinct creates a single column table with column "Result".

Helpful resources

Announcements
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 (4,676)