I need to be able to use the value of a subfield to identify the row of data I need from either a Repeater Field or Flexible Content. I’d be grateful for any wisdom on which field type is best for this purpose.
My current thought is that a Flexible Content field would be best. I could create unique Layouts and use ACF’s built-in function to search for the layout I need to identify the row I need. I would never repeat the same layout in the same post.
Is my thinking correct here, or have I missed something?
Thanks for your feedback!
As long as a layout is not repeated, yes.
The value stored in the database for a flex field is an array of layout names. If you use
$layouts = get_post_meta($post_id, 'flex_field_name', true);
to get this value the result will be this array. The index containing the layout name will be the row of the flex field you are looking for.