cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
scootter
Level: Powered On

Making a data form visible depending on a selection

Apologies if this is answered somewhere else but I cannot find it. Smiley Sad

 

Basically I have a form and depending on selections made from a Drop Down list in DataCard 1, I want other cards to be visibile.

 

 

By example:

 

Card 1 has a list of A, B & C.

 

If you pick A, Card 5 should appear, if you don't, it shouldn't. If you select B, then Card 6 should appear, etc.

 

I thought it was just a formula in the "Visible" field of DataCard5, but when I tried some of the formulas I found here it doesn't work, and no errors are shown.

 

I tried this in the Visible section in DataCard5: If(DataCard1.Selected.Value="A",true,false)

 

I am sure it is a simple fix, but I am stumped Smiley Sad

Any advice is really appreciated! 


Accepted Solutions
MatthewInwards
Level: Powered On

Re: Making a data form visible depending on a selection

You can use or but you have to use the right syntax. For example,

 

If(Or(DataCardValue4.Selected.Value= "A", DataCardValue4.Selected.Value= "B"),true,false)

 

Hope this helps and feel free to ask any more questions Smiley Happy

MatthewInwards
Level: Powered On

Re: Making a data form visible depending on a selection

If you use radio buttons you can have your selection of the 10 different choices and then your formula in the visible property of the field will look something like this.

 

If(Radio1.Selected.Value = "7",true,false)

 

Hope this helps Smiley Happy


All Replies
MatthewInwards
Level: Powered On

Re: Making a data form visible depending on a selection

Hi @scootter,

 

You were not that far off to be honest. Your error lies with referencing the entire datacard rather than the drop down box within the card. If you drop down the data card on the left side of the screen then you will see something that will say DataCardValue and then a number after it. Lets say its DataCardValue1. your formula will then be

 

If(DataCardValue1.Selected.Value="A",true,false)

 

Put this is the visible section of the Data Card.

 

Hope this helps Smiley Happy)

scootter
Level: Powered On

Re: Making a data form visible depending on a selection

Thanks very much indeed! As a follow up, can I use a variable like or?

 

So if a user selects A or B the field appears?

 

Would the formula be: If(DataCardValue4.Selected.Value="A" or "B",true,false)

 

Thanks!

 

Scootter

MatthewInwards
Level: Powered On

Re: Making a data form visible depending on a selection

You can use or but you have to use the right syntax. For example,

 

If(Or(DataCardValue4.Selected.Value= "A", DataCardValue4.Selected.Value= "B"),true,false)

 

Hope this helps and feel free to ask any more questions Smiley Happy

scootter
Level: Powered On

Re: Making a data form visible depending on a selection

That's great, thanks!

 

 

scootter
Level: Powered On

Re: Making a data form visible depending on a selection

Hi again,

 

I did have a question about Calculated Columns in Lists if I may.

 

I have added a Lookup Column to retrieve a value from another list, and I'd like this to make up part of my unique ID. I called this field Reference ID

 

I worked out with a Flow to set update a field with the ID generated when an item is added, and I concontenate this with some text. 

=CONCATENATE("2019-Action_",TEXT(MYID,"000"))

 

When I go to the formula, however; the column I added named Reference ID is not available. Any ideas?

 

If I just try and put it in I get a Syntax error.

scootter
Level: Powered On

Re: Making a data form visible depending on a selection

Also,

 

Is there a way to use AND, so if you select item A and item B,C,D,etc it appears?

 

Thanks!

 

Scott

MatthewInwards
Level: Powered On

Re: Making a data form visible depending on a selection

Hi @scootter,

 

Im afraid I personally dont know much about using calculated columns within powerapps, however, what experience I do have has been bad and I personally would advise using some form of workaround if its possible. Would it be possible to simply use the automatically generated ID collumn within sharepoint? If not let me know and I will try to help with a soloution.

 

As far as your other question, yes you can use the and functions. You formula will look something like this

 

If(And(DataCardValue4.Selected.Value = "A", DataCardValue4.Selected.Value= "B"),true,false)

 

Hope this helps Smiley Happy

scootter
Level: Powered On

Re: Making a data form visible depending on a selection

Hi,

 

That's great, I think what I want to do isn't logically possible as I thought about it.

 

Or too confusing for SQL I suppose. Smiley Happy

 

I wanted to be able to have 10 options, and if you select option 7 say, it will always show and additional field, but if you don't, so you pick 1,2,3,4,5,6,8,9 & 10, no field will appear.

 

I can't seem to work that one out though Smiley Sad

 

It was a nice to have anyway, as was the calculated column ID. Smiley Happy

 

Thanks!

 

Scott

MatthewInwards
Level: Powered On

Re: Making a data form visible depending on a selection

If you use radio buttons you can have your selection of the 10 different choices and then your formula in the visible property of the field will look something like this.

 

If(Radio1.Selected.Value = "7",true,false)

 

Hope this helps Smiley Happy