Jump to content

Cannot create worksheet in workbook


Go to solution Solved by Bryan Zimmerman,

Recommended Posts

Posted

Dear all, 

I cannot create an additional worksheet in a workbook via Datalab although I tweaked the code proposed by the AI assistent. (version seeq-spy 193.17)

Regards

Filip

 

image.png.3b83b4569e6ffe9157c815294ed4242d.png

  • Seeq Team
Posted

Hi Filip,

The syntax for adding a worksheet is...

new_worksheet = my_workbook.worksheet('Extra_Worksheet')

You could add items to the worksheet by setting the display items. For example...

items = spy.search({'Path': 'Example >> Cooling Tower 1 >> Area B', 'Type': 'Signal'})
new_worksheet.display_items = items

And then pushing the workbook...

spy.workbooks.push(my_workbook)

I've logged a ticket to improve our documentation in this area, which will also allow the AI Assistant to provide a better answer.

Thanks for the question!

Bryan

  • Like 1
Posted

Thanks Bryan, that worked. But I have an additional question.

Why do I get an empty workbook_df when trying to look for the workbook via its path ... which is not the case when I look for it via the ID?

image.png.dc1340c258a001d6943377233ab67451.png

  • Seeq Team
  • Solution
Posted

Hi Filip,

There are two issues preventing the search from working as expected:

  • The Analysis Name needs to be specified separately from the Path
  • The "My Folder" needs to be removed from the path (SPy defaults to searching in "My Folder")

This will work...

spy.workbooks.search({
    'Path': 'Python', 
    'Name': 'TestWorkbook'
})

It is possible to specify "My Folder" in the Path, but a constant must be used as follows...

spy.workbooks.search({
    'Path': f'{spy.workbooks.MY_FOLDER} >> Python', 
    'Name': 'TestWorkbook'
})

You would use the same technique if you wanted to search in the CORPORATE, PUBLIC, or SHARED folders.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...