Help with computed field syntax

Hi guys. I'm trying to create a computed field on the shopifyProduct model that checks if the product images have alt texts defined. That field would check all shopifyFile records associated with the product (through the shopifyMedia model) and return 'all' if all files have alt texts defined, 'some' if only some or 'none' if none of them have alt texts. Is that possible using gelly? I've tried a few things but I'm not getting anywhere really. Any help is much appreciated!
2 Replies
ljspoor94
ljspoor948mo ago
You would probably need to return two values, and do an every/some for each and perhaps give them an alias
RenanVSouza
RenanVSouzaOP8mo ago
Well, it looks like I can't use aliases: Field fragments can't alias the field expression -- the name of the field is the fragment name. However I think that having two computed fields - one with the total media count and one for the media with alt will solve my problem

Did you find this page helpful?