cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver II
Resolver II

set dropdown to empty (allow empty selection is set to true) when the items are [true,false]

I have a dropdown containing true and false and I want to reset the value to blank.


Dropdown:
The items are boolean values.

Items: [true,false]
Default: defaultPaxOnBoard

Allow empty selection is set to true.

On the Home screen before navigating to the page with the dropdown I thought it would be as simple as this...

Set(defaultPaxOnBoard,"");

Set(defaultPaxOnBoard,true);

Set(defaultPaxOnBoard,false);


None, of these work. The items is a manually typed value and not a SP List.

 

 

 

3 REPLIES 3
Super User
Super User

try this

items =[' ', true,false]

DefaultSelectedItem = ' '

Sort of. That does appear to fix the issue with 1 of my 3 dropdowns defaulting those but just with the text items.
Items: ["","Yes","No"]

Both the defaulting works and my filtering using the dropdown values in this object.

My issue remains with the 2 dropdowns that contain currently a true/false

Items: ['',true,false] - it barks at me for that...

sasrsc_0-1602219709580.png

So I tried ["",true,false] and it accepted it in the dropdown.

sasrsc_1-1602219739914.png

That works with the setting of the default dropdown value BUT now my previous filter on the gallery doesn't work and I'm not sure how to fix it...

The filter "extract" here...

sasrsc_2-1602219900686.png

reportingSAS is a boolean...
DdReportingSAS is now (I believe) treated as Text because of my adding the "" into the items declaration so then it doesn't matter whether I change it to blank, false or true it will never equal the reportingSAS value as that's a boolean true/false whereas the dropdown (I think) is being converted to a text string now and no rows appear.

OK, this is bizarre...

In the 2 dropdowns that were ["",true,false]

I changed those back to boolean [true,false] but I still have the allow empty values.

The defaulting seems to be sporadically working now even though I didn't change my set values.

(I did erase the filter statement and did it from scratch again)

I know PA can be finicky.

 

I then changed the text dropdown back to items: ["Yes","No"] and all the filtering seems to be working again.

But the defaulting of the dropdowns is hit and miss. I need to better isolate this to get everyone's help as it seems like it depends what the previous value was as to whether the defaulting is working... 

Sorry...for not being clearer.... 


Refresh(ComplianceApproval);Refresh(CompliancePassengers);Refresh(ComplianceTrips);
Set(defaultComplianceStatus,""); /* this always works for setting the default the items are ["Approved","Approved (Blanket)", "Not Started","Pending","Rejected"] */
Set(defaultReportingRequired,""); /* this seems to work the items are ["No","Yes"] */
Set(defaultReportingRequiredSAS,false);  /* this seems to work the items are ["No","Yes"] */
Set(defaultPaxOnBoard,true); /* this doesn't seem to work for defaulting [true,false] */

I even show a label for defaultPaxOnBoard so I know it's set to true...

But the dropdown won't go to the correct item as the default

 

This really doesn't make any sense 

 
 

 

 

 

 

 

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (66,888)