Add a New Special Field Replacement

Background


I am creating a Google form for people to submit any errors they find in my shared deck. Given that the deck is huge, I did something like this to my cards:

Screenshot-2024-11-08-23-34-31-49-a9eef3a2a561b80d5c76daebd0f9a14c

Notice the bottom-right corner. The icon there, when clicked should take people to a Google form with information about the card pre-filled. The users, then can simply tell me what’s wrong with the card and I’ll already know which card they are talking of :brain:

Issue I’m Facing


But I need a value that I can use to pinpoint the card. I have considered adding an extra field to the note types but,

  1. I don’t know how to quickly fill in unique values to that field for all my notes :sob:
  2. I think it’s less helpful when you have a lot of sibling cards.

Request


Could you add a special field replacement like {{CardID}} or {{NoteID}}, please?


If there is already a way to include unique IDs in links like this and anyone here is aware, please also tell me.

2 Likes

https://ankiweb.net/shared/info/8897764

This adds a uuid to an empty field named “Note ID” when opening the add or edit note window.

Special Fields

The type of card ("Forward", etc): {{Card}}

{{Note ID}}+{{Card}}

3 Likes

Thanks for the workaround. But for multiple reasons, an extra field won’t be viable for my purposes. I’ll still see if I can do something.

1 Like

Hey, seems like this doesn’t work after all.

I can’t use the add-on on Android, but I still tried adding {{Card}} but seems it doesn’t add card type number. It’s obvious now looking at the docs but without the card type number, it’ll not work for cloze.

Most of my cards/content is cloze. Example:

Screenshot-2024-06-05-09-35-17-52-a9eef3a2a561b80d5c76daebd0f9a14c

Then I guess it’ll also not work for Image Occlusion notes (and just a few days ago, I converted all IOE cards to IO notes manually :sadge: ).

1 Like

Object IDs

2 Likes

Cloze Templates

{{#c1}}
    #1
{{/c1}}

{{#c2}}
    #2
{{/c2}}

..
{{#cN}}
    #N
{{/cN}}
1 Like

I of course know how to search cid/nid otherwise I won’t be able to use cid/nid info from people.

The second link perplexed me a bit at first but now I realise I can include conditionals in the pre-fill link itself. Thanks, Keks!

1 Like

@dae what do you think about adding {{nid}} as another special replacement? I would still like to have this.

1 Like

The current implementation incurs a (small) cost for every extra field we add, regardless of if it’s used, so I’m reluctant to add more until we can implement it better. That said, I appreciate the problem the OP is trying to solve, and think we can probably add an exception in this case. We’d need to decide on a name - ‘nid’ is unlikely to conflict with people’s existing fields, but is inconsistent with the other special fields. ‘NoteID’ would be more consistent, but I think there are some shared decks that use it already, so it would be a bit more disruptive.

2 Likes

I don’t think consistency is that important here so {{nid}} isn’t bad. And {{NoteID}} sounds good too. I assume most people would be using that field to store Note IDs so even if the behaviour changes, that shouldn’t be an issue for them, right?

I don’t think consistency is that important

People on the OCD spectrum might disagree :slight_smile:

that shouldn’t be an issue for them, right?

If their setup depends on the IDs store in a note field, and those IDs differ from Anki’s note ID, then their setup could break until they rename the field.

4 Likes

Another solution is to add {{CardID}} instead of {{NoteID}}. If you get the card, then you also know the note. What do you think?

I assume the only reason a lot of people use {{NoteID}} is because they are using the fields of their note to store the data. And so, you can’t have different data for sibling cards.

Special fields allow card-specific data to be retrieved (like flags) so {{CardID}} would work right?

This feels like the ideal solution, we are neither sacrificing users with OCD nor we are breaking existing notes and decks.

1 Like

In the OP’s case, the note id would probably be preferred, but you make a reasonable point, and if we’re only adding one, the card ID is more flexible & less likely to conflict.

1 Like

the OP is me btw :sweat_smile:

Hah :sweat_smile:

Yes. Most of my decks — and all of my shared decks — have their own Note IDs to ensure uniqueness across the decks and the collection.

Using NoteID might not be a problem, as my decks use “Note ID” as the first column. This is a habit developed from initially using an odd-on that created a column of the same (or similar?) name.

However, if you decide to use that name/field, I can change all the decks that I have shared.

1 Like

There you go.

5 Likes