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

Show Hide Asterisk Power Apps Dropdown

I have a Canvas App Form where I hide the continue button until all required fields are filled in i.e. are not blank.

 

Once the field is filled in the red asterisk is hidden. This works correctly for the text controls i.e. if I start typing in text the asterisk disappears and if I delete the text within the text control the asterisk reappears.

 

PROBLEM: However with the dropdown controls - by default they are blank - once an entry is selected the asterisk disappears BUT if I clear the entry (back to blank) the asterisk does not reappear.

 

This is the Visible function I am using on all the asterisks: If(IsBlank('DataCardValue-xxxxxx'),true,false)

 

Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Great. I will try that - it may not be correct for my problem. It is not a ComboBox (see attachment).

 

My solution that works for Visible (I'm sure the function could be more succinct) is for an employees Title (Mr, Mrs etc...)

 

If('DataCardValue-Title'.Selected.Value="Mr" Or 'DataCardValue-Title'.Selected.Value="Miss" Or 'DataCardValue-Title'.Selected.Value="Mrs" Or 'DataCardValue-Title'.Selected.Value="Ms" Or 'DataCardValue-Title'.Selected.Value="Dr" Or 'DataCardValue-Title'.Selected.Value="Prof" Or 'DataCardValue-Title'.Selected.Value="Rev",false,true)

 

This shows and hides the asterisk as I intend.

 

I will be able to use your solution in another part of the form - but if there are any further suggestions to simplify this (I'm happy I've got it working with my own function - I'm sure it could be improved).

 

Thanks for the reply.

 

View solution in original post

4 REPLIES 4
iAm_ManCat
Super User II
Super User II

Hi,

 

I think you mean a combobox rather than a dropdown?

I was able to use your formula above with a combobox and confirmed the same behaviour.

 

I would suggest to use the following code for the combobox, where we both check for IsBlank and we check for the number of selected rows:

If(
   CountRows(ComboBox1_1.SelectedItems)=0 || IsBlank(ComboBox1_1),
   true,
   false
)

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Great. I will try that - it may not be correct for my problem. It is not a ComboBox (see attachment).

 

My solution that works for Visible (I'm sure the function could be more succinct) is for an employees Title (Mr, Mrs etc...)

 

If('DataCardValue-Title'.Selected.Value="Mr" Or 'DataCardValue-Title'.Selected.Value="Miss" Or 'DataCardValue-Title'.Selected.Value="Mrs" Or 'DataCardValue-Title'.Selected.Value="Ms" Or 'DataCardValue-Title'.Selected.Value="Dr" Or 'DataCardValue-Title'.Selected.Value="Prof" Or 'DataCardValue-Title'.Selected.Value="Rev",false,true)

 

This shows and hides the asterisk as I intend.

 

I will be able to use your solution in another part of the form - but if there are any further suggestions to simplify this (I'm happy I've got it working with my own function - I'm sure it could be improved).

 

Thanks for the reply.

 

View solution in original post

Hi @Fitz ,

 

Have you tried using Len function instead of IsBlank? If you specify a single string as the argument, the return value is the length as a number. If Len returns zero then it is blank.

 

-bochie

For your dropdown, do you have 'AllowBlankSelection' to true?

 

I was able to use a dropdown with your original formula

If(IsBlank('DataCardValue-xxxxxx'),true,false)

and it put the asterisk back after I de-selected the item

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (98,247)