How to specify the group from a variable when creating a file with iOS shortcuts

Hi, i am trying to create a pdf file in Devonthink using shortcuts.
The file is well created if I selected the group manually.

Now I want to select the group in the “Create File” action by using a variable.

Regardless of the content of the variable, the file is always created in the inbox.

How to set the group in the variable?

In my example, the group is in “Personnel/Fichiers Finance/”

I tried to put it in the variable but the document still saved in the inbox.

Any idea?

Maybe it is related to Shortcuts/Create File - How to set file to variable?

For the file as variable, a workaround exists here: Create file in DEVONthink using Shortcuts app - #4 by dvrooman

My question is not about the file but about the group.

I feel like there has to be a better way, but what about using a search?

Thank you so much.
I tried it and it works.

However, the search does not work with accents. For example for “Bien-être” it does not work.

I tried to make a manual search in Devonthink app and I didn’t have results. So I think it’s a Devonthink bug.

Your solution is already saving me a lot of time so it’s already very good.

Thanks again.

Glad it’s helping!

Interesting about the accent. I just tried making a group called Bien-être and doing a search in Shortcuts. Seems to work fine for me. I searched “etre” as well as “être” and both returned the group.

I also bashed out a test script for cases where you have multiple matches. You can select from a list as to which one the document should be put in. It isn’t great though: I couldn’t figure out a way to have it show the parent group/database, so all the options will look the same if the name is identical. If you’d like it, let me know and I’ll post…

Thanks for your feedback.
I did some tests then i found out that the problem wasn’t about the accent but about the “-” in “Bien-être”.
As the “-” is taken by devonthink as an Operator for search criterias.

1 Like

Makes sense. Although, it seems to work in a search using Shortcutds for me.