# Enter data from input from repeater instance

**URL:** <https://forum.wixstudio.com/t/enter-data-from-input-from-repeater-instance/38998>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [August 28, 2020, 5:17pm UTC](https://forum.wixstudio.com/t/enter-data-from-input-from-repeater-instance/38998 "2020-08-28T17:17:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![willwoodard](https://avatars.discourse-cdn.com/v4/letter/w/848f3c/32.png) [@willwoodard](https://forum.wixstudio.com/u/willwoodard)\
**Post date:** [August 28, 2020, 5:17pm UTC](https://forum.wixstudio.com/t/enter-data-from-input-from-repeater-instance/38998/1 "2020-08-28T17:17:12Z")

</div>

I have a repeater on a page. It looks at a database and only shows a repeater box for the data lines where the field “vetted” is false.  
I have a switch on each repeater box. When I move the switch to checked, I want to find the data line associated with that repeater box instance and set the “vetted” field to true.  
But I don’t seem to be accessing the correct data line.

The switch is named “switch1”.  
Code looks like this:  
export function switch1\_click(event, $w) {  
//get the current item in the database  
let items = $w( “#entriesreadwrite” ).getCurrentItem()  
//get the content of the field  
let vetfield = items.vetted  
//If the switch is checked, set the value  
//in the associated database to true, else set to false  
if ($w( “#switch1” ).checked){  
$w( “#entriesreadwrite” ).setFieldValue( “vetted” , **true** )  
}  
**else** {  
$w( “#entriesreadwrite” ).setFieldValue( “vetted” , **false** )  
}  
}  
URL is this : [https://willwoodard0.wixsite.com/website-1/vetting-pages](https://willwoodard0.wixsite.com/website-1/vetting-pages)

I think I’m misunderstanding how getCurrentItem works. I’m assuming that when you click the switch, it finds the current repeater instance and also finds the data line that fills it.

What am I missing? Thanks for your help!
