Data Binding If Statement

Good evening,

I have a data table where I have integer column, student_grade, for the grade that students are in. For Kindergarten it shows up as a 0 (zero).

Is is possible to show that 0 as a K through data binding in my repeating panel?

I believe you can use a Conditional expression python statement, but I can’t seem to get it working.

Any help is greatly appreciated.

Yes. For example, you can take the following general approach:

1 Like

Thanks for the response. Ironically that was a response from a previous question of mine too! Very new to all of this, but loving it!

I am just unsure of how to only make it refer to when it shows a zero …I thought (and very well could be wrong) that the previous one worked because there was nothing in the column.

is it something like:
‘K’ if self.item['student_grade] == 0 else self.item[‘studnet_grade’]

…sorry I really have no idea!

You’ll want in general

'desired_value' if self.item['your_column']==actual_value else some_other_value
2 Likes

Thank you! …I feel like I was so close on a couple of attempts, but must have been missing something!

Thanks again! Greatly appreciated!

1 Like