cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MariusSolend
Level: Power Up

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

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;
}
1 ACCEPTED SOLUTION

Accepted Solutions
MariusSolend
Level: Power Up

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

1 REPLY 1
MariusSolend
Level: Power Up

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 322 members 6,151 guests
Please welcome our newest community members: