How to add single option set to Data Type via API workflow

I’m having issues updating a data type and adding a single option set via an API workflow.

The set up:

  • Data Type: Product can have a single
    • Color (option set) - have 5 potential ‘Shape’s to choose from (Circle, Oval, Square, Rectangle, irregular)

The flow:

  • Creating a new Product via an API workflow
    • Sending text to workflow that contains either: ‘Circle’, ‘Oval’, ‘Square’, ‘Rectangle’ or ‘Irregular’
      • Don’t see a way to find the correct Shape to add to product.

Previously this has worked when adding a list of Option Sets with ‘All [Option Set]:filtered’

You seem to run workflow in loop? (iteration). Do you really need this?

It’s hard to help because we don’t see how you set the API Workflow itself (how the data are coming. Did you set the parameters that seem to be keywords as Option set type? … this is what you should do if possible…)

“You seem to run workflow in loop? (iteration). Do you really need this?” - Yes, I’m adding hundreds of products at a time so I iterate over them.

  • I’m uploading a CSV, with the data structured as either text or numbers. For Shape this would be text for ‘Circle’, ‘Oval’, etc
  • I’m sending a list of data to the workflow and running a recursive workflow. So it will be listed as ‘Circle’, ‘Square’, ‘Circle’, etc
  • For adding plain text (like for ‘upc’ I use ‘upc:item #iteration’) and for adding a list of option sets (like ‘Color’) I use ‘Color add list All Color:filtered’ but for ‘Shape’ (a single option set) I don’t know how to connect the text ‘Circle’ to finding the correct Shape option set to add. I initially thought I could do a search for the Shape Option Set’s Display.

I will suggest creating a loop and going over one by one and adding to the product.

Steps

  1. Create a backend workflow
  2. Pass product
  3. pass filter
  4. Pass the keywords
  5. Then create a loop that goes over each one and add it to the product.

Thats what I was thinking about doing but thought ‘this sounds far too complex to add an Option Set, I must be doing something wrong’….

…apparently not.

You doesn’t say why you are using loop… Schedule API on a list is better. But you may have some reason to use loop. (If you can use Schedule on a list, it’s better because it’s cheaper and faster).

As from your settings the first thing you seem to do wrong is to set the type as text instead of option set directly. If your display is what you provide as a list tonyour backend wf, there’s no reason to not set this directly to OS type

About shape, the issue is that you are sending a list of shape but the field is = … so only one item?

Went with this solution.

Seems highly inefficient, but it will work for now.

You should care about efficiency… But your choice :wink: