Robotic Process Automation (RPA)

 View Only
  • 1.  Delete rows

    Posted Thu February 15, 2024 01:05 PM

    Hi,

    My bot is traying to delete a row, bot it does not working, after this I opened the file and the row still there.

    This is the script:

    defVar --name empleados --type Excel
    defVar --name trabajadores --type DataTable
    defVar --name cantidad --type Numeric
    excelOpen --file "C:\\Users\\EfectivaVPN\\Downloads\\AlexVirrueta\\employees.xlsx" empleados=value
    excelGetTable --file ${empleados} --getfirstsheet  --entiretable  --hasheaders  trabajadores=value
    deleteRows --where "Name= \'Ned\'" --dataTable ${trabajadores} cantidad=changedrowscount
    logMessage --message "${cantidad}" --type "Info"
    excelClose --file ${empleados} --save

    Thanks for your help



    ------------------------------
    Alex Virrueta
    ------------------------------


  • 2.  RE: Delete rows

    Posted Fri February 16, 2024 02:13 AM

    Hello!

    As per my knowledge,  It seems like you're using a script to delete a row from an Excel file, but it's not working as expected. To troubleshoot, first, make sure the condition for deleting the row is correct. Then, check if the deletion process itself is functioning properly by printing the contents of the Excel file before and after the deletion. Finally, ensure that the Excel file is being saved correctly after the deletion.

    I hope this will help you out...



    ------------------------------
    Mach Brown
    ------------------------------



  • 3.  RE: Delete rows

    IBM Champion
    Posted Sat March 02, 2024 01:06 PM

    Hi Alex,

    From what I can see, you are missing a command to write the filtered Data Table to the Excel file. Adding a Create from Data Table command right after deleteRows should make it run as you expect. The deleteRows command only filters the Data Table in the specified variable, it does not update the Excel file, that is why adding a command to write to the Excel file should fix it.



    ------------------------------
    Vinicius Marques
    ------------------------------



  • 4.  RE: Delete rows

    Posted Thu March 07, 2024 03:15 PM

    Hi Vinicius,

    I can delete rwos from the data table and write them in a new sheet of my spreadsheet.

    Now I want to delete columns, more than one, is there any command to perform this action?, Delete Columno only deletes 1 column at once.

    Thanks for your help

    Regards



    ------------------------------
    Alex Virrueta
    ------------------------------



  • 5.  RE: Delete rows

    IBM Champion
    Posted Thu March 07, 2024 05:42 PM

    Oh, I don't think there is a way to remove multiple columns at once using default commands. If they are already in an Excel file, you could try executing a VBA macro on the file. If you have a Data Table and only write to Excel later, I suggest you remove one column per time using the command you already found if there aren't any issues with that. It should be an instant operation.



    ------------------------------
    Vinicius Marques
    ------------------------------