Hello,
I want to make a button visible if any one of several dropdown values is selected. I was trying to build up the statement using the Or/ || syntax but this isn't working.
Here is the example of what I tried:
If ("Text from Dropdown 1"||"Text from Dropdown 2" in Dropdown1.Selected.Value, true)
Is it possible to set the button's visibility based on one statement, or do I need a multiple instances of the button each with one statement for each condition that makes it visible?
Solved! Go to Solution.
If( Dropdown1.Selected.Value = "condition1" || Dropdown1.Selected.Value = "condition2", true, false)
Try that 🙂
Sean
You can go about this a few ways.
The simple approcah is:
In the button's Visible control field:
If(Dropdown.Selected.Value="Text from Dropdown 1", true,false)
Perhaps you need to create another list to assist you in your rules. You can compare values without the need to keep adjusting the syntax, it a lot more managable.
Then you can create syntax on a filter to show the button.
Create another list for example with 1 column, then create a collection from that. Collect(ButtonKeywordsCollection,'ButtonKeywords')
Title: ButtonKeywords
Now on the buttons Visible control field:
if(Dropdown.Selected.Value = Lookup(ButtonKeywordCollection,Dropdown.Selected.Value = Column1,Column1,true,false))
if(Dropdown.Selected.Value || Dropdown2.Selected.Value = Lookup(ButtonKeywordCollection,Dropdown.Selected.Value = Column1,Column1,true,false))
This syntax may be different from SharePoint list and an excel sheet.
You can come up with methods like this is you think inline syntax will get too unmanageable.
If( Dropdown1.Selected.Value = "condition1" || Dropdown1.Selected.Value = "condition2", true, false)
Try that 🙂
Sean
You can go about this a few ways.
The simple approcah is:
In the button's Visible control field:
If(Dropdown.Selected.Value="Text from Dropdown 1", true,false)
Perhaps you need to create another list to assist you in your rules. You can compare values without the need to keep adjusting the syntax, it a lot more managable.
Then you can create syntax on a filter to show the button.
Create another list for example with 1 column, then create a collection from that. Collect(ButtonKeywordsCollection,'ButtonKeywords')
Title: ButtonKeywords
Now on the buttons Visible control field:
if(Dropdown.Selected.Value = Lookup(ButtonKeywordCollection,Dropdown.Selected.Value = Column1,Column1,true,false))
if(Dropdown.Selected.Value || Dropdown2.Selected.Value = Lookup(ButtonKeywordCollection,Dropdown.Selected.Value = Column1,Column1,true,false))
This syntax may be different from SharePoint list and an excel sheet.
You can come up with methods like this is you think inline syntax will get too unmanageable.
Works beautifully. Thanks so much, Sean.
This is very clever and works great. Thanks Nick!
Dont referene the DataCard. but the DataCard Value i.e Dropdown.value
If(DropDownControl.Column = "Station", true, false)
You can get quite complex if you need by doing things like so.
If(DropDownControl.Column in ["Station","Shop","Park], true, false)
If(DropDownControl.Column in ReferenceCollection.Items, true, false)
If you have multiselect dropdown values and you want to have conditional visibility you can use the following condition in visible property of that Card or whatever,
If(CountIf(DataCardValue.SelectedItems,Value="Selection Required")>0,true,false)
@bean wrote:If( Dropdown1.Selected.Value = "condition1" || Dropdown1.Selected.Value = "condition2", true, false)
Try that 🙂
Sean
How would I go about doing this if I am referencing a datacard from a Form?
example:
Form: Form5,
DataCard: Test Data Card,
DataCardValue: DataCardValue76.
I have a multi-select dropdown DataCardValue47 containing values (Individual, Third Party, Contractors).
I want to show/hide DataCard1 when
Selected values in the DataCardValue47 are Individual, Third Party, Contractors
OR
Individual, Third Party
OR
Individual, Contractors)
OR
Individual
Don't show when selected values are
Third Party, Contractors
Third Party
Contractors
Visible
If(DataCardValue47.Selected.Value = "Individual", true, false) --- This condition works fine.
Please advise the correct logic.
Logic i was trying
If(DataCardValue47.Selected.Value = "Individual", true, false) ||
If(DataCardValue47.Selected.Value in ["Individual","Third Party","Contractors"] but data card still shows when i just select Third Party or Contractors
User | Count |
---|---|
183 | |
108 | |
88 | |
44 | |
43 |
User | Count |
---|---|
226 | |
108 | |
105 | |
68 | |
68 |