How to have a "virtual field" in a resource based from another resource?
I have a
That relationship is defined by this field in the
The
What I want to do is to create a
My first approach was to add this new relationship to the resource:
So I can get access to the
After that, I tried creating a calculation that would join that relationship and "extract" the
That don't work, and I'm not sure how exactly I would filter that calculation to only get the
My second approach was to try an aggregate:
This also doesn't work, and aggregates also will generate a more complex query instead of simply doing the join by
Any suggestion on how I can acchieve that?
Organization resource that has a many to many relationship with my User resource.That relationship is defined by this field in the
Organization resource:The
UserOrganization resource has a special attribute inside of which defined if the user is an admin inside that organization:What I want to do is to create a
virtual attribute in the Organization resource that will tell if that user (the actor) is an admin.My first approach was to add this new relationship to the resource:
So I can get access to the
UserOrganization resource directly from Organization.After that, I tried creating a calculation that would join that relationship and "extract" the
admin? field:That don't work, and I'm not sure how exactly I would filter that calculation to only get the
user_organization from the actor.My second approach was to try an aggregate:
This also doesn't work, and aggregates also will generate a more complex query instead of simply doing the join by
organization_id and user_id.Any suggestion on how I can acchieve that?
