Title: Complex Field’s -&gt;set_min( $num ) working
Last modified: September 1, 2016

---

# Complex Field’s ->set_min( $num ) working

 *  Resolved [Adrián Ortiz Arandes](https://wordpress.org/support/users/boquiabierto/)
 * (@boquiabierto)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/complex-fields-set_min-num-working/)
 * Hi! How is ->set_min() on a complex field intended to work? Coming from ACF I
   thought it should “pre-build” as many rows as declared but it doesn’t seem to
   work as I’m setting it up. An example would be:
 *     ```
       Container::make('post_meta', 'Configuration')
       	->show_on_post_type('whatever_post_type')
       	->add_fields(array(
           	Field::make('complex', 'whatever')
           		->setup_labels(array(
       			'singular_name' => 'whatever rule',
       			'plural_name' => 'whatever rules'
           		))
       	    	->add_fields(array(
       		    	Field::make('select', 'abc', 'ABC' )
       		    		->add_options(array(
       			    		'a' => 'A',
       					'b' => 'B',
       					'c' => 'C',
       				)),
       	    	))
       		->set_min(1)
       	));
       ```
   
 * Thanks for your support! Great developer framework!
 * [https://wordpress.org/plugins/carbon-fields/](https://wordpress.org/plugins/carbon-fields/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [htmlBurger](https://wordpress.org/support/users/htmlburger/)
 * (@htmlburger)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/complex-fields-set_min-num-working/#post-7619473)
 * Hey [@boquiabierto](https://wordpress.org/support/users/boquiabierto/), thanks
   for the kind words! Glad you like the plugin.
 * About the `set_min()` methods, it doesn’t force the user to add the fields, so
   it doesn’t pre-populate them, it’s just a limiter, but you can combine it with`
   set_required()` to force the user to populate the complex groups.
 * Hope this answers your question.
 * If you want to make a suggestion or submit a bug report, please open a new Issue
   in our [Github repository](https://github.com/htmlburger/carbon-fields).

Viewing 1 replies (of 1 total)

The topic ‘Complex Field’s ->set_min( $num ) working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/carbon-fields_cacbcc.svg)
 * [Carbon Fields](https://wordpress.org/plugins/carbon-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/carbon-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/carbon-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/carbon-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/carbon-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/carbon-fields/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [htmlBurger](https://wordpress.org/support/users/htmlburger/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/complex-fields-set_min-num-working/#post-7619473)
 * Status: resolved