Custom Field sorting

so i have this rg the default is created date descending is yes

I want it when the user press the column it will sort that field

Now i want to create a workflow with 2 custom state ofc (1 is text the other is yes/no) with the workflow looks like this below

when a column is press it start from Name ascending yes (press again)-> Name ascending no (press again)-> reset the sorting

How can i implement it on bubble?

sorry, if it’s not clear im very bad at english

Never mind guys i solved with only 3 custom state and a single workflow