Skip to main content
RobAllen_19FT
Participating Frequently
January 11, 2020
Answered

How to create a smart collection with a collection criteria?

  • January 11, 2020
  • 2 replies
  • 1296 views

I'm trying to create a smart collection with two rules: rating >= 1 and collection contains all some collection name and it's not working. This is the code:

 

searchDesc = {
  combine = "intersect",
  {
    -- 1 star or above
    critera = "rating",
    operation = ">=",
    value = 1
  },
  {
    critera = "collection",
    operation = "all",
    value = collectionName

  },
}
catalog:createSmartCollection(smartCollectionName, searchDesc, nil)

 

Where collectionName is the selected collection.

 

When I edit the smart collection that's created, the first rule is set correct, but the second rule is set on "rating" with the operation and value blank.

 

What am I doing wrong?

This topic has been closed for replies.
Correct answer john beardsworth

"criteria" not "critera" ?

2 replies

john beardsworth
Community Expert
john beardsworthCommunity ExpertCorrect answer
Community Expert
January 11, 2020

"criteria" not "critera" ?

RobAllen_19FT
Participating Frequently
January 11, 2020

Thank you John!

 

Clearly, I can't see the wood for the trees!  I suspect that I was fooled by the first one worked - presumably because "rating" is the default if it's not set. Grr!

Thanks again,

Rob

josephlavine
Community Expert
Community Expert
January 11, 2020

Please post a screen capture of your Create Smart Collection window.

Thanks