Append to Craft document problem

Hello - I’m new here. I have for some time been happily using @FlohGro ’s action to append items of shopping to Craft docs for several stores. Now, rather mysteriously when I select my ‘Shopping’ action, instead of displaying the list of stores I get the alert “more than one configuration draft with title: Shopping exist please clean up the mess (merge these two Drafts and run the action again”

My problem is that I can’t figure out how this has come to be nor where the configuration drafts are stored so I can delete one or merge them.

Use the quick search in drafts and search for „Shopping“ maybe rename your configuration draft to something more unique :slight_smile:

Thank you @FlohGro! A quick search revealed only one file named “Shopping” (the actual configuation draft) and also one I recently added named “# Append Draft to Craft Shopping List”.

I hadn’t appreciated that foundDraft = Draft.queryByTitle(configurationDraftTitle) would find drafts whose name contained rather than was the exact title.

Yes i didn’t prevent that in the script because that’s how the query function works.

If you use the secondly mentioned Draft as configuration title then your script will work again.

All is now working fine again for the online stores in my original list (thank you) but I am now trying to set up a new store to shop from. I have created and named a page for it in Craft and added the deep markdown link for it to the configuration draft. When I try to append items to it, the action goes through the steps OK but nothing is actually appended. I don’t know if this is a Craft or Drafts issue. Maybe something changed in an update? I can’t see any structural difference between the new store page and the others, and appending to the others still works as before…
Any ideas @FlohGro or anyone?

Can you make an example of your setup and post it here? I don’t completely get what you have set up now :slight_smile:

Thanks @FlohGro I am using your ‘Append to Craft’ script to append entries in Drafts to one of a several Craft pages, each representing a shop/store I buy things from. I followed the demo in this video. Craft is configures as per screenshot*. The configuration draft I am using is:

# Shopping

[Lakeland](craftdocs://open?blockId=0A2A2EA3-9994-4ACB-893F-A4C506EF9072&spaceId=8ac3f6e6-931f-b9b1-dbb8-ae7e9f8d219b)
[Ocado](craftdocs://open?blockId=0F581E9A-BFF8-4DC5-823E-FD13687E31FA&spaceId=8ac3f6e6-931f-b9b1-dbb8-ae7e9f8d219b)
[Waitrose](craftdocs://open?blockId=859E9FFD-FB91-45A5-9D08-D17C56C16692&spaceId=8ac3f6e6-931f-b9b1-dbb8-ae7e9f8d219b)
[Sainsburys](craftdocs://open?blockId=4DD187D8-20D9-46F1-9117-74C64553055E&spaceId=8ac3f6e6-931f-b9b1-dbb8-ae7e9f8d219b)
[Brindisa](craftdocs://open?blockId=78DD3378-EAA9-4F59-99A2-D741FAD2DB01&spaceId=8ac3f6e6-931f-b9b1-dbb8-ae7e9f8d219b)
[SousChef](craftdocs://open?blockId=C5865C62-8508-41A3-8F31-92AD717A997F&spaceId=8ac3f6e6-931f-b9b1-dbb8-ae7e9f8d219b)
[Farmison](craftdocs://open?blockId=8E5E966F-EB61-4D96-8C06-CCF37530F1C6&spaceId=8ac3f6e6-931f-b9b1-dbb8-ae7e9f8d219b)

It is working fine for all but the recently-added store (Farmison).

Uploading: Screen Shot 2022-11-26 at 12.59.06.png…
*For some reason Discourse seems to freeze uploads before completion. I can send sparately if necessary.

I can’t see the screenshot as you said…

The configuration seems valid for me.
Can you please try to do the following:

  • copy the configured links (all lines in the draft)
  • delete the draft end remove it from the trash
  • run the append action again
  • check if it created a new draft „Shopping“ (I recommend to name it mor specific in the config script - e.g. Craft Shopping Lists
  • then paste your links into the document again
  • run the action and test if it’s working now. (Maybe you have to scroll in the prompt)

Thanks @FlohGro Unfortunately it hasn’t helped, which makes me think the issue is with Craft (or my understanding of it) rather than Drafts. What I have been able to do is append a truncated greyed-out version of the append text:

Test

Another test

below the first line/block after the Farmison title.

(Thankfully image upload worked this time.)

The action still works as expected for me - I don’t know what you mean with your truncated text.

When I create a draft like:

test
1
2
3

And then run the Append to Craft Note Action it appends the text as expected.

Did you make further changes in the script besides changing the name of your configuration draft?
Do you have the latest versions of Drafts and Craft installed?

Can you redownload the action and test if it works if you don’t change the name of the configuration draft and copy a few lines of your configuration into the default one?

The strange thing is that the action works as expected for me too but onlywith the original six stores (see screenshot): it’s just the one I have recently added [Farmison] which doesn’t work properly: sometimes nothing is appended (though the action thinks it has been); sometimes it is appended but all in one line as in the earlier screenshot. This makes me think something is different in Craft.

Yes both apps are up to date. I have not changed the action script.

Maybe create a new document for that shop and delete the old one in Craft. Then add the markdown deeplink to the configuration draft again

Yes, indeed, have tried that over and over!

This function has been my only use for Craft: I am mainly an Obsidian user. I have therefore decided not to renew my (expensive) Craft subscription due later this week and will see if I can emulate the function in Obsidian though it probably won’t be as elegant.

Thank you @FlohGro very much for your help and patience.

You can definitely do that - I already created similar actions for obsidian - just search in my topics in the forum for „Add to Obsidian Note“