Shotgun Find filters syntax

   3558   4   0
User Avatar
Member
65 posts
Joined: Feb. 2013
Online
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
Edited by merlino3d - Nov. 14, 2019 14:03:57
User Avatar
Staff
529 posts
Joined: Aug. 2019
Offline
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.
Edited by johnmather - Nov. 14, 2019 13:57:28
User Avatar
Member
65 posts
Joined: Feb. 2013
Online
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}]
Edited by merlino3d - Nov. 14, 2019 14:10:17
User Avatar
Staff
529 posts
Joined: Aug. 2019
Offline
The Shotgun API expects a list of lists. The following should work:

[['project', 'is', {'type': 'Project', 'id': 327}]]
User Avatar
Member
65 posts
Joined: Feb. 2013
Online
Ooooooo great! It works!

Thanks a lot John!
  • Quick Links