Hi all! Is there an easy way to go into the data and change all slugs of our products (data type = product) to “[titleword1]-[titleword2]-[titleword3]-…”
Hopefully easy (and of course I can figure out)!!! Thank you!
Hi all! Is there an easy way to go into the data and change all slugs of our products (data type = product) to “[titleword1]-[titleword2]-[titleword3]-…”
Hopefully easy (and of course I can figure out)!!! Thank you!
There are numbers of ways to do this.
You can upload them using a csv file; you go to the DB sort the titles by anything u’ll remember, say “date” copy all lof it in order of sorting to your excel, map each one of the slug to each product’s unique ID and upload it back to the DB.
Another way is to set up a backend workflow to make this happen, much easier but WU (if you entries are much of course) …
Set up a “new database trigger”
type =product
Action; set a thing slug -
Things to change =product before change
Slug= products title
Great! Once I set up, how do I run it to change the slug across all 40,000 or so data points in the dataset (i.e., how do I trigger the workflow across the entire dataset)? Thanks!
In app editor in app data use bulk button
There you have it
Thank you again for the help (and unfortunately still having trouble). I set up the database trigger but having trouble triggering it (“bulk” does not show this trigger and instead prompts me to create a new API workflow). Thanks!
Hi @numismy I was stuck for a while on this too but thanks to your thread I figured it out. I hope you have too but I thought I’d write it down for anyone else wanting an answer
Create a text field that is what you want your slug to be. You can also dynamically create the slug using existing fields, and it will automatically change the text to lower case and add ‘-’ instead of a space. If there are multiple of the same text in your database, it will also automatically add ‘-1’ or ‘-2’ etc to the end of your slug to ensure all are unique.
Go to Setting → API and ensure these boxes are ticket, as well as the data type you would like to work on
Go to Backend Workflows and create a new API Workflow. Name it, and then set up a key, the type should be the type of data you want to set the slug for
Add an action ‘set a thing’s slug’, which is under the ‘Data (things)’ tab. Set the ‘thing to change’ as the option available under “WORKFLOW DATA SOURCES”. This is the key that you set up in step 3 and is the info the API passes to this workflow. Then set up the slug how you want; if you want to combine multiple text fields to create a unique slug, I recommend using the dynamic input option ‘arbitrary text’ so you can set out a long slug using multiple fields. As I said before it will automatically change the text to lower case and add ‘-’ instead of a space.
Return to your data. If you would like to run this workflow on only certain things, and not the whole data set, click ‘New View’ and then set up your conditions.
Click ‘bulk’.
Select your API workflow from the drop-down and click ‘run workflow’.
Refresh your data to see your new slugs!
I hope this helped; I, for one, always appreciate it when someone in the forum gives a comprehensive guide.
This topic was automatically closed after 70 days. New replies are no longer allowed.