Search code examples
google-app-maker

How to display boolean value as an image in Google App Maker's table?


I have a table with bound data from datasource. I want to display true value as an image like a check mark, not as a number. How to do that?

Example of data in the table


Solution

  • Assuming that your widget for your value is a label widget, you can change the style variant toward the top left side of the editing page (next to the widgets button) to an 'Icon' style. Then put the following binding in your text property for the widget:

    @datasource.item.YourBooleanField ? 'Check' : ''
    

    After that you can apply CSS to the label to change the color to the red color you show in your image.