Excel file - Records are not getting updated/saved

Hey @scsvel,

The reason is for what you are experiencing is that a repeat loop “detaches” from the record. If you want it to work you need to add by reference at the end of your repeat.
This is by design and intended but not very obvious.
References to Containers | EPF Docs (eggplantsoftware.com)

This suite and video might be useful. It was “eye opening for me” :slight_smile:
ReferencesDemo.suite GitHub
Keysight Eggplant SenseTalk References (youtube.com)

Set xlFile to ResourcePath("my_file.xlsx")
Set xlSht to table "Sheet1" of {type:"excel", file: xlFile, writeable:"yes"}

Repeat with each item current_record of the records of xlSht where ColumnA is not empty by reference
      set current_record's ColumnC to "my updates here"
End repeat

@Javi: Your code works because you create a direct reference within you first set command. Its not needed when you use the “by reference” and you can use the Iterator variable current_record.

Hope this is helpful and let me know in case you do have further questions.

Cheers,
Karsten

2 Likes