Flow: use tag as placeholder for in "run script"

I am trying to use the “Flow” feature to convert files. The “run script” should run when “tag assigned” is set. I would now like to pass the tag name as a parameter for the run script. But in the manual at https://github.com/nextcloud/workflow_script#placeholders there is no matching placeholder documented.

Is there a placeholder, or how else could I pass a parameters of the script depending on the tag assigned?

Run script: /tmp/script.sh %n %XYZ
where script could look like:

ffmpeg -i $1 $2.webm

(where $2 should contain the tagname (%XYZ))

Thanks for any comments or Ideas!
RainerP

I think that isn’t possible yet. You have to create multiple script calls each one for a single tag, or you try to read/extract assigned tags using e.g. an API call as described here. The example api calls are to set or delete a tag, but it shouldn’t be that difficult to create a get request based on it.

Additionally you can create feature request in the app specific GitHub repository:

1 Like

You know file ID (%i - file id), so you can easily retrive TAG via API. E.g. based on this

it could be something like:

curl -s -m 10 -u $user:$password ''$NextcloudURL'/remote.php/dav/systemtags-relations/files/'$fileid'' \
-X PROPFIND --data '<?xml version="1.0" ?>
<d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:prop>
    <oc:id />
    <oc:display-name />
    <oc:user-visible />
    <oc:user-assignable />
    <oc:can-assign />
  </d:prop>
</d:propfind>' | xml_pp | grep -w "$tagName"

You only need to have a user that will have an access to this file to be able to call this API.

1 Like

thanks @gas85 and @j-ed for your comments. I will try to extend my script to retrieve the tag via curl. But this would require to store the user and password in the script. This may be a quick hack, but I don’t like it …

So I will try to prepare a feature request.

1 Like

Please create an Application password for it. You can also store it in a config file with 400 permissions for you Web user.