Editing fields and changing note-type of existing synced notes on AnkiHub

Hey guys,

Got another tricky question for you, which I don’t know how easy it is to solve, but it is proving to be a bit of a headache for our Malleus deck and the @Malleus-Maintainers and would love to hear if you guys have any potential solution for us!

Essentially, we have begun to crack down on copyright in our deck much more rigorously, and we realise although we don’t really have that many cards on in our deck at the moment on it, we are unlikely to get permission to reuse ‘First Aid’ images, nor ‘Oxford Handbook’ or ‘AMBOSS’ and therefore these fields ought to be deleted altogether. In addition, we want to rename our ‘eTG Complete’ field to ‘Therapeutic Guidelines’ to reflect a change in the name of this resource, to which we are in the process of seeking permission to use content from. We also want to add 2 new fields called ‘Extra (Synced)’ and ‘Additional Resources (Synced)’ to keep track of content we have copied across multiple cards (ie. tables) that syncs using the NoteSync plugin we have started experimenting with.

Here’s the fields of our current notetype:

Here’s the fields of our new prototype notetype that we want to ideally convert our cards to:

Attempt #1

Essentially what I tried to do (in a sandbox AnkiHub deck, so it didn’t mess anything up on our actual Malleus deck) was:

  • Sync a card using the current Malleus notetype
  • Change the notetype of existing cards using the old notetype to the new notetype which involved using the ‘fields’ editor:
    • Deleting the ‘First Aid’, ‘AMBOSS’ and ‘Oxford Handbook’ fields
    • Added ‘Extra (Synced)’ and ‘Additional Resources (Synced)’ to the new notetype
    • Renaming the field titled ‘eTG Complete’ to ‘Therapeutic Guidelines’
  • Update the BACK template HTML + STYLING CSS to reflect the changes in the fields (deleted removed fields, added new fields) and pushing all of these changes using the ‘Deck Management’ features
  • Resynced

This actually synced successfully, but it had several issues:

  • The renamed field ‘Therapeutic Guidelines’ was recognised by AnkiHub as a new field, rather than replacing the existing ‘eTG Field’
  • The supposedly deleted ‘First Aid’, ‘AMBOSS’ and ‘Oxford Handbook’ fields all remained on AnkiHub and therefore part of the notetype

The only successful change was the new ‘Extra (Synced)’ and ‘Extra (Additional Resources)’ fields were added.

Attempt #2

My next attempt was to try something different and instead of editing the notetype directly and syncing, was to keep the old notetype, syncronise, then add a new card with the new prototype notetype (and sync as a ‘new notetype’), and then change over the old note-type to the new note-type using the Right click > Notes > Change note feature.

Unfortunately when I tried to resync once a card had already been synced on an old notetype once the change had been made to the new ‘prototype’ it did not let me resync as it saw the same note-id and prevented the sync due to note-id conflicts. Presumably this is necessary to prevent issues whereby a sync of this sort would cause issues on AnkiHub whereby edit history of a particular field would be corrupted in the case where you merge field content from one ‘old’ field to a ‘new field’, or lost altogether if you remove a field in its entirety.

Potential Solutions

The obvious easiest way around this is to create an entirely new AnkiHub deck and sync with the correct notetype from the start, but we obviously want to avoid this given our 1500+ subscribers. The other alternative I can see is if you were to delete literally every single card and resync with AnkiHub as duplicate cards with a unique note-ID - this however would absolutely ruin people’s progress on cards which is obviously suboptimal, and mean there would be 7000+ duplicate cards in the ‘AnkiHub deleted’ that users would have to manually get rid of. I also know you can essentially hide certain field content using HTML, but it’s still there in the browser and it’s definitely not very clean.

Obviously we would love there to be some feature in AnkiHub whereby change-note features are enabled to allow for safe deletion and renaming of fields without issues, however I imagine this is technically complicated. So I would like to request whether there could be some back-end way to allow for the notetype change we are trying to do, potentially by removing the existing sync with AnkiHub on cards altogether, then allowing us to make the change-note conversion and letting us resync the cards to AnkiHub again. I imagine this would wipe all past note change history and discussion/etc. but we probably wouldn’t mind too much, as the benefits of our new notetype for our workflow would be immense and we likely wouldn’t make any further big changes to our notetype moving forward.

Is this at all possible?

Cheers,

  • Stapedius

Deleting/Renaming fields is not supported, but if I recall correctly, it’s possible to delete fields from the backend. I’ll do some tests and get back to you.

3 Likes

I did some tests and here’s what I found:

  1. We can delete fields from the backend, but they will stay in the user’s collection, because the add-on will now consider them as extra user fields and stop touching them.
  2. Renaming fields is not supported and can result in data loss if done from the backend directly.
2 Likes

Really appreciate your help in testing this out @abdo.nh! So just to clarify, if you were to delete fields on the backend, if someone new who hasn’t already downloaded the deck were to download the deck, would they have the deleted fields visible for them? And theoretically could existing users to manually delete those fields locally without any issues with syncing?

I think it’s looking like we should play it safe and just keep the fields there and remove them from the HTML/CSS for users.

New users won’t have the deleted fields. Existing users can delete them manually with no issues.

That’s the best option for now. I created a ticket to look into supporting deleting/renaming fields properly in the future.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

@Stapedius

1 Like

Hey @abdo.nh ! The backend deletion of those fields has worked well - thanks for your help.

Sorry to add another unwanted episode to this field editing saga, but I unfortunately jumped the gun slightly and pushed the new ‘Extra (Synced)’ and ‘Extra (Additional Resources)’ fields out to users slightly prematurely before configuring them.

In reference to the above image, I wonder whether the following changes can be made on the backend to the new ‘Extra (Synced)’ and ‘Additional Resources (Synced)’ fields:

  • Editing the ‘Description’ and ‘Font size’ to as shown on the image
  • Editing the ‘Options’ to ‘Collapse by default’ to as shown on the image

I know this could have been avoided if I pushed the changes correctly after configuring them to the above, but oh well! I’m hoping maybe this is possible without going through the annoyance of deleting again and restarting from scratch (but this would be my final request on this topic if the above is not possible!).

Look forward to hearing your reply!

  • Stapedius

Hope you can help me out with this! :slight_smile:

Just pushed the change.

1 Like

Amazing! Works almost perfectly - just wondering if you can enable the “collapse by default” setting for those 2 fields - that’s the only config setting which didn’t seem to push through :slight_smile:

1 Like

Done.

2 Likes

Absolute legend!! Someone needs to give you a raise - happy new year! :blush:

2 Likes