Can I get the sheet name from an Excel file?

Hi. I have a bot that needs to read an excel file and process its data. For it to work properly, the sheet must have a specific name. However, people who create the files for the bot to read are having trouble saving the file with the correct name.

I know there is the Rename sheet acitivity, but I need to know the original name of the sheet in order to rename it, and I can’t guess how people are going to name it beforehand. Is there a way to get the sheet name from the data in the file in the background, without opening the file?

Hello @cris-dsc

I don’t know if that is possible or not. But I can suggest you a work around for this problem, if you can use it in your project.

Is that possible you create a new sheet “Sheet Names” and ask user to add the name of the sheet that user wants to create in this sheet and then create a new sheet with the exact same name added in the “Sheet Names”. This way you could get the names of all the sheets created by the user. You can access any sheet create by the user and process its data.

I hope it helps you.

Hi @cris-dsc yes you can get it using Js method.

sheetName = Object.getOwnPropertyNames(excel_content)[0]

Best Regards

1 Like