Querying custom attributes

3 posts in this topic


I'm trying to filter assetversion using custom attribute, but got an error:


As you can see when I inspect the custom_attributes of a version object it did show me the "downstream" attribute is there.  Did I miss something?

Also, how to compare a bool value? Am I using it right?




Share this post

Link to post
Share on other sites

Hi there,

you have to specify key, value pairs if you want to query custom attributes and metadata. The right syntax is

s.query('AssetVersion where custom_attributes any (key=downstream and value=True)').first()

Also notice that bools are written in upper case. So true won't work as value.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now