Support

Account

Home Forums General Issues Fetch all the available values of a specific field based on another field

Helping

Fetch all the available values of a specific field based on another field

  • So suppose I have a select field, say book, where I have a list of books. When I choose any book, another field called page appears (text field). I want to get all the available pages based on the selected book. For example, suppose there’s book A that has pages 1,3,4,5 (there are posts related to that book, each post for each page in the book), and there’s book B that has pages 1,3,8,10. I want to get all the available pages for book A.
    I’ve tried using get_field_object, but it doesn’t seem to work. Is there any neat way to fetch all the pages available rather than scanning the whole posts in database, and filtering each one whether it is related to book A and to page X?

  • Hi @ghuigjvyt

    Many questions:
    1. another field called page appears (text field) – how does this relate to your question?
    2. Is your question regarding the backend or frontend?
    3. You have tried get_field_object – where? with what code? What do you mean “it didn’t work?”

    Perhaps you could read over your question from someone elses shoes and re-write it so it is clear to understand.

    Thanks
    E

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Fetch all the available values of a specific field based on another field’ is closed to new replies.