1
$\begingroup$

I am trying to get Anki to only create a card if field A or field B is not empty. Delightfully, the only operations available to me to do this are testing if the field is present (#A[text]/), if the field is not present(^A[text]/), and nesting these conditions (#A^B[text]/). Interestingly, there is one sort of OR built into this system: #A[hello]/#B[world]/ will create a card if A is not empty OR B is not empty. However, I specifically need (A OR B)[hello]/ and the above will give me one of {∅, hello, world, helloworld} when I need to reduce it to {hello}.

$\endgroup$
2
  • $\begingroup$ Defining a new (logical) operation seems like fun! Is it what you're trying to do though? If A empty then if B empty then 0 else 1?! 🤔 $\endgroup$ Sep 30 at 5:53
  • $\begingroup$ @AgentSmith I'm not sure where you are getting "If A empty then if B *empty then 0 else 1." If you are getting it from the (#A^B[text]/), that was just an example of notation. Also, is that "else 1" applying to the outer "if A empty" or the nested "if B *empty"? $\endgroup$
    – grepgrok
    Sep 30 at 5:57

1 Answer 1

0
$\begingroup$

Of course, as soon as I post this, I find... a solution:

#A[hello]/#B^A[hello]/

However, this feels a little janky as this requires copying out the text twice which could become extremely unwieldy with significantly long texts.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .