cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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

Highlighted
New Member

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

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

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

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,918)