Bidirectional expression binding?

I am setting up some inputs for users to create recipes. I am using a template that is repeated a number of times in a template repeater. I need the option to switch between C & F (both input & display). I set up template properties of temperature & temperatureMetric. The temperature input field is tied to either based on the selection of standard or metric system (a client tag) but normally I’d tie the temperature float value to the temperature property (see below).


Is there a way to dynamically tie the temperature or temperatureMetric property based on what measurement system is selected that also works with bidirectional binding? Like using indirect tags with properties instead of tags or making the bidirectional option work in expressions? I need this to work just like derived tags but in a template repeater where a user can input either C or F but with the F value always available (calculated from C field if necessary) since that is what the database takes. I’m probably overthinking this. What is the most direct way to make this work? Thanks!

1 Like

The easiest hack is probably to have two fields on top of each other. And depending on the tag values, make one or the other visible. Then both can have a bidirectional binding, but only one will work.


Off topic; Calling a system that’s only used by 3 countries world wide as “Standard” worries me a bit though…

Heh. I credit the U.S.'s standard units for unintentionally teaching Americans to reason about binary, including binary fractions. For example, three liquid cups is 0.0011 (binary) gallons. Or 0.3 (hexadecimal) gallons.
I’m not opposed to the metric system, and it is present all over the U.S., but I won’t be giving up pounds, gallons, and miles anytime soon.

I guess that means, being from Flanders, I should speak in Flemish miles. Though I still have to figure out if I mean small, medium or big Flemish miles … :wink:

Indeed. I’m hopelessly provincial, though – U.S. units are the best. :grinning:

I’ve done this in other places so I’m not sure why I didn’t think of it here. I’ll go with layering. It would be cool to have an indirect property binding option though. Standard is the term I learned in grade school so it just stuck :grinning: