Hi,
how can I delete hundreds of files that are not marked as private?
I have used the following successfully on âthingsâ in my database - I hope (and assume) it can be used on files (as long as you use the correct corresponding datatype), but not positive. So please report back on your findings
Also take note - if these are files in the live database, make sure you switch your editor view to âLiveâ so youâre deleting the files there and not from Dev.
You will need to create a Backend workflow (you may need to enable these in your settings, under the âAPIâ tab, âEnable Workflow API and backend workflowsâ). Under the âWorkflowâ tab, now choose the dropdown where youâd typically choose your page, but instead click âBackend workflowsâ. Create a new Backend workflow, and choose âNew API workflowâ. Give it a name, and click âAdd a new parameterâ. The word you use for the âkeyâ isnât as important, but Iâd give it something similar to the data type in case you need to reference it. Once you give it a key, you can choose the âTypeâ â make sure this is the type of data you are deleting. You do not need to choose the checkbox âis a list/arrayâ.
Now add an action (step 1) to the workflow telling it what to delete: Choose âDelete a list of thingsâ, and then Type of things, choose the data type you need to delete. âList to deleteâ, do a âsearch for [data type things]â. Now click on this search, and click on the button âAdd a new constraintâ. This is where youâll choose âPublicâ = âNoâ (or however youâve marked your data as not public). This will constrain the delete action only to these non-public things.
Finally, go to the âDataâ tab, click on the data type, and choose the tab âApp dataâ. On the top right of the spreadsheet view is a button âBulkâ. Click this, and under the âAPI workflowâ dropdown your Delete workflow should be available and in black font (if it were gray it would mean there was a mis-alignment of data types or similar). Choose it, and it will tell you how many items are about to be affected by it. Finally, click âRun workflowâ. This will delete the files that are not marked as private.
This topic was automatically closed after 70 days. New replies are no longer allowed.