• I have an extended user pod with a many to one relationship (related_credits) with a pod ‘credit’ which in turn has a one to many relationship (related_production) with a pod ‘production’. I want to list the production entries related to a particular user ordered by a field in the production pod. Can I achieve this by using the orderby option on the relationship field in the user pod? ie something like “orderby related_credits.prodnumber DESC” where related_credits is the relationship field in the user pod and prodnumber is a numeric field in the production pod.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes, you can do that, just see https://pods.io/docs/code/pods/find/ for the syntax you’ll use in orderby for selecting.

    Something like this should work:

    'orderby' => 'related_credits.prodnumber.meta_value'

    Hi

    Can I accomplish the same thing in the “Control Panel” forms. I have portal where the users will fill the data and I need them to see their own data only.

    Also I need to display the values of a relationship depending on the selection of another relationship in the same custom type form.

    Thanks for help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘pods relationship fields orderby’ is closed to new replies.