False positives during the text replacement

I’m trying to set up a day evaluation shortcut, but it doesn’t work (and in a quite peculiar way).
I have a daily note with the following YAML-code:

created: 2024-05-28
  - daily_note
exercises: "%%exe_ph%%"
yoga: "%%yoga_ph%%"
swimming: "%%swimming_ph%%"
cycling: "%%cycle_ph%%"
diverse: "%%div_ph%%"
meditation: "%%meditation_ph%%"
drinking: "%%drinking_ph%%"
smoking: "%%smoking_ph%%"
classes: "%%classes_ph%%"
drawing: "%%drawing_ph%%"
mood: %%mood_ph%%

And I try to substitute placeholders for “1” and “0” by using “choose from list”, “if…else…” and “search and replace”. All of the main moves are present in the screenshot below.

My problem is roughly the following: if I select yes to the first question, than a lot of false positives happen (I press “no” on a question down the line, yet I still get “1” in a property field, and vice versa. Can you please take a look, I attach the link to the shortcut here.

Thanks in advance,

Hmm… I have a clean vault with a bare minimum of plugins, and I’m afraid I can’t reproduce this problem. Doesn’t mean there is no issue, mind :wink:

Could you temporarily disable all other plugins other than Actions URI to find out if the issue is indeed with AFO and its companion plugin?

I ran it on the the vault only with AFO and daily notes.
Here is what I get: https://youtu.be/Lffh8GLIVhI
Sorry if my initial description in terms of false positives was maybe misguiding, it’s rather just the systematic discrepancy between the input and output.
Also, it’s very possible that it’s me setting up the shortcut poorly, and not the AFO problem, in which case excuse me.

The video helped to understand the problem, and once I knew what I was looking for, it was easy to spot.

The discrepancy (“false positive”) happens after answering “Did you do other sport?”, right? This is because the If action following that Choose from List block is not using that block’s result but an earlier one. It’s (hardly) noticeable by the missing connector between the two actions:

Once you select the right variable/result, the connector will appear:


Update: Here’s a quick explainer on how to rename actions’ result values to reduce confusion when juggling a lot of them:

It did help, thank you!

And thanks for the video! Somehow I have hard times finding good practice advice\comprehensive tutorials for Apple shortcuts in the, so this kind of tips are very useful.

Trust me: You’re not alone in this. :wink:

1 Like