SOLVED

Single line text field to be hidden except when Others is selected from choice form field.

Copper Contributor

Hi all,

 

I have a choice form field and a single line text form field. I would like the single line text field to be hidden except when Others is selected from choice form field. How do i do that?

 

jeralynw_0-1702885183862.png

 

If Others is selected, Relationship - Others field will appear. If not, it stays hidden

 

I have tried the following but it's not working.

 

Visible: 

If('Relationship to Emergency Contact_DataCard2'.Selected.Value = "Others", true, false)

 

This is the error message that i got:

jeralynw_1-1702885358765.png

 

4 Replies
best response confirmed by jeralynw (Copper Contributor)
Solution

@jeralynw I think you are trying to get the selected value from "data card" instead of drop down/combo box control - this is causing this issue.

 

Try this:

  1. Expand your data card, you will find drop down or combo box control inside it (generally control name starts with DataCardValue followed by integer number
  2. Use the name of drop down/combo box control in the formula instead of name of data card.
  3. Use formula like: 
    If(DataCardValue10.Selected.Value = "Others", true, false)​

    or simply: 

    DataCardValue10.Selected.Value = "Others"

    where DataCardValue10 is the name of related drop down or combo box control


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@jeralynw Example of expanding the data card and finding out the related control inside it: 

ganeshsanap_0-1702902351199.png


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Thank you very much for your explanation!! It's easy to understand and your solutions worked.

The field is showing only when Others is selected.

 

However, now when i try to submit other options, the response does not flow through to my list.

I had made the Relationship - Others field mandatory.

 

When i made the field non-mandatory, the response can flow through.

 

How to make the field mandatory and still allow responses for other options to flow through?

@jeralynw Try this:

  1. Do not make the "Relationship - Others" field mandatory from SharePoint list settings
  2. Make "Relationship - Others" field mandatory from Power Apps customized form by settings Required property of data card related to "Relationship - Others" field to: 
    DataCardValue10.Selected.Value = "Others"

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

1 best response

Accepted Solutions
best response confirmed by jeralynw (Copper Contributor)
Solution

@jeralynw I think you are trying to get the selected value from "data card" instead of drop down/combo box control - this is causing this issue.

 

Try this:

  1. Expand your data card, you will find drop down or combo box control inside it (generally control name starts with DataCardValue followed by integer number
  2. Use the name of drop down/combo box control in the formula instead of name of data card.
  3. Use formula like: 
    If(DataCardValue10.Selected.Value = "Others", true, false)​

    or simply: 

    DataCardValue10.Selected.Value = "Others"

    where DataCardValue10 is the name of related drop down or combo box control


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post