Dynamic visibility – Custom field Query

1

Greetings.

I have a question about this functionality. I’d like to know if two things are possible:

  1. Rendering one SVG or another, depending on the type field. For example, if type is video, one icon; if it’s gallery, another icon.
  2. Hidden an element based on whether the author field exists.

Data:

[
    {
        "type": "video",
        "url": "https://www.youtube.com/watch?v=dQw4w9WXcQ",
        "autor": "Rick Astley"
    },
    {
        "type": "gallery",
        "url": "https://freepik.com/free-photos-vectors/gallery"
    }
]

I currently have something like this for point #2 but it doesn’t work.

Screenshot: https://imgur.com/a/tiBsNFK

Yulian David

Replies

Response

  1. Problem here that your customer field is not regular, it’s even not array. It’s repeatable group. You can check type of specific group, like field[0][type] must check type of first group

Post a Reply

About the Author