web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error/Bug with control...
Power Apps
Unanswered

Error/Bug with control of type TwoOptions with usage "bound"

(1) ShareShare
ReportReport
Posted on by 13

I think there is a bug in the function ParseRaw in the SimpleFormatter.ts file which is a part of the framework.

When i use TwoOptions my value type is boolean.

If my value is false, it will return on line 4.

If my value is true, it will step into the ManifestType.TwoOptions case and result in the following error:

"e.toLowerCase is not a function"

Because "toLowerCase" does not exist on a boolean value.

Im i doing something wrong here? My ManifestTypes.d.ts file generates boolean values for my TwoOptions control.

 

export function ParseRaw(value: string, type: string): any {
 let valueRaw: any;

 if (!value) {
 return value;
 }

 switch (type) {
 case ManifestType.Decimal:
 case ManifestType.FP:
 case ManifestType.Currency:
 valueRaw = isNaN(parseFloat(value)) ? undefined : parseFloat(value);
 break;
 case ManifestType.OptionSet:
 case ManifestType.WholeNone:
 valueRaw = isNaN(parseInt(value, 10)) ? undefined : parseInt(value, 10);
 break;
 case ManifestType.DateAndTimeDateAndTime:
 case ManifestType.DateAndTimeDateOnly:
 valueRaw = new Date(value);
 if (isNaN(valueRaw)) {
 valueRaw = undefined;
 }
 break;
 case ManifestType.TwoOptions:
 valueRaw = value.toLowerCase() === 'true' ? true : false;
 break;
 default:
 valueRaw = value;
 }

 return valueRaw;
}
I have the same question (0)
  • jolake Profile Picture
    Microsoft Employee on at

    Providing a boolean is correct. This appears to be an error in our tooling only, you should see no issues with this control in an actual application.

    We will file an internal bug to have the tooling system updated appropriately. Apologies for this inconvenience.

  • Marius Solend Profile Picture
    13 on at

    Thanks for the reply 🙂

     

    So this will only happen when i run it in the localhost debugger and not when i host the control in D365?

     

    Regards.

     

    Marius

  • jolake Profile Picture
    Microsoft Employee on at

    Hi Marius,

    This is correct. The code you've pointed out is specific to the testing harness, and doesn't exist in production code.

    -John

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,070

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 608

Last 30 days Overall leaderboard