I’m working on a watch face using the Facer Creator that uses a few conditionals, but after poking around at the syntax for a while, I cannot get even the simplest conditional to work.
To test it out, I set up a Text Object with the Text field containing $ #DISDAYTIME# ? Day : Night $. Up until I add the last $, the output displays “$ true ? Day : Night” (as it should), but as soon as I stick the last $ on there, the output goes blank. Syncing the face to my watch shows “$ true ? Day : Night $” as the text of the object, which is definitely not what it should do.
Hey @harbichidian! Sorry about your frustration, to make conditionals work you’ll have to add a boolean operator and take out the spaces in the first segment of the conditional: $#DISDAYTIME#==true?, so your final expression will look like this: $#DISDAYTIME#==true? Day : Night $.
We’ll be updating the referencing page to make this more clear. Let us know if you have any other questions!
Ah, I definitely misunderstood that from the documentation. The way it is written appears to require spaces around the special characters. Thank you for the clarification!
Thanks – any ideas on how to get strings with spaces in it working would really help out! Seems like it should be easy, but string comparisons in quotes do not seem to work (contrary to the example shown in the documentation: Conditionals | Facer Documentation – $ #Da# == "AM" ? 1 : 0 $).
Ultimately, what I am trying to do is take a string that says one thing and reprint it as another thing (e.g. transform "Los Angeles" to "City of Angels").