Highlighted

How to create a smart collection with a collection criteria?

Jan 11, 2020

Copy link to clipboard

Copied

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?

Adobe Community Professional
Correct answer by john_beardsworth | Adobe Community Professional

"criteria" not "critera" ?

Topics

SDK

Views

157

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to create a smart collection with a collection criteria?

Jan 11, 2020

Copy link to clipboard

Copied

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?

Adobe Community Professional
Correct answer by john_beardsworth | Adobe Community Professional

"criteria" not "critera" ?

Topics

SDK

Views

158

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Jan 11, 2020

Copy link to clipboard

Copied

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

ThanksScreen Shot 2020-01-11 at 11.47.47 AM.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Jan 11, 2020

Copy link to clipboard

Copied

"criteria" not "critera" ?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 11, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...