Search - User list
Full Version: Shotgun Find filters syntax
Root » PDG/TOPs » Shotgun Find filters syntax
merlino3d
Hi guys,

I'm trying to get all the shots (possibly Tasks, and then the shot field from them), using custom filter in the Shotgun Find node. The problem is I can't make it works correctly. There's some attempt:
#1 filters = [['project', 'is', {'type': 'Project', 'id': 327}]]
#2 filters = [['project', 'is', {'type': 'Project', 'id': 327}], ['entity.Shot.code', 'is', p.shotKnob.value()]]
#3 [['project', 'is', {'type': 'Project', 'id': 327}], ['entity.Shot.code', 'is', p.shotKnob.value()]]
#4 filter = [['project', 'is', {'type': 'Project', 'id': 327}], ['entity.Shot.code', 'is', p.shotKnob.value()]]
#5 filter = [['project', 'is', {'type': 'Project', 'id': 327}]]
I'm not sure what I'm supposed to enter in the custom code.

Thanks in advance for your help!
Marco
johnmather
Hi Marco,

If you want to get every result, you can set the Filter Type to “Custom”, and then remove all text in the Shotgun filter. This is essentially the same as passing an empty list.

You don't need the variable assignment as this is done for you.
merlino3d
Hi John, and thanks for your reply.

The only real filter should be the project id in my case, but using this code doesn't works:
['project', 'is', {'type': 'Project', 'id': 327}]
johnmather
The Shotgun API expects a list of lists. The following should work:

[['project', 'is', {'type': 'Project', 'id': 327}]]
merlino3d
Ooooooo great! It works!

Thanks a lot John!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB