cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fpc-kdrosario
Helper I
Helper I

Default value for toggle showing warning

Good day,

 

I am having issues with the default value of my toggle button.

I set the default value of my toggle button to:

 

If(!IsBlank(Parent.Default), Parent.Default, false)

 

 

But when I put that code on the default of the toggle button, a warning shows on it and says:

 

Warning: Expecting a true or false value. The current value may cause unexpected behavior.

 

 

Is there a better approach on this one? Because the Parent.Default value is being used for the offline data handling.

 

Thanks!

K.D.

2 REPLIES 2
krishnags
Responsive Resident
Responsive Resident

It might be due to the Parent.Defualt is a generic function and it is unable to read it. Try specifying the value of the toggle 

RandyHayes
Super User
Super User

@fpc-kdrosario 

This would be occurring because you are mismatching your returns.

Assuming that the Parent is connected to a column in your datasource that is a true or false (yes/no) type, then you can consider changing your formula to the following:

Coalesce(Parent.Default, false)

If your Parent column is NOT a true false type, then you will only be able to do something like:

!IsBlank(Parent.Default)

 

If you have some other scenario for the parent column, post back and we can take a look at the scenario.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,933)