Conditional formats error

Posted by: sachot on 10 August 2020, 11:36 pm EST

    • Post Options:
    • Link

    Posted 10 August 2020, 11:36 pm EST - Updated 3 October 2022, 1:12 am EST

    Hi,

    When i add a conditional format based on formula, i get an error when i try to get the rules list.

    But no problem with text rule.

    Is it a bug or i do something wrong ?

    Thanks,

    Christophe

  • Posted 12 August 2020, 12:41 am EST

    Hi Christophe,

    To get a JSON string representation of conditional rules, you need to use the following code:

    var formatsJSON = sheet.conditionalFormats.toJSON();
    var stringifiedRules = JSON.stringify(formatsJSON && formatsJSON.rules);
    console.log(stringifiedRules);
    

    Regards

    Sharad

  • Posted 30 August 2020, 10:09 pm EST

    It works.

    Thanks !

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels