Format True/False in Data Binding

Sorry I am super new to anvil and a novice with python …but I am trying!

Is there a way to format a True/False return in the data grid?

…all I really want is for my ‘status’ column in the table to show “checked out” in the repeating panel when it’s True.

Data Binding:
self.item[‘status’]

Any help would be appreciated.

Hello and welcome,

You could try something like this for example:

'checked out' if self.item['status'] else 'not checked out'

That can be done in the designer’s data binding area or in the editor by setting item.

1 Like

Welcome to the Forum!

For clarity of wording, I’d be inclined to change the column heading (and maybe even the column name) instead, e.g., “Checked Out” (and self.item['checked_out']). That way, the name is consistent with the usage.

Thank you much. I figured there was an easy way to do it, but just wasn’t sure how …even after hours of searching!

1 Like