Jump to content

Appending new page to organizer topic


Willem Grob

Recommended Posts

Hi there I am currently facing issues with pushing images from DataLab to the same Organizer Topic. I saw some different posts here regarding the same topic but they didn't seem to solve my issue.

I have two pieces of code in Datalab with jobs scheduled and would like to push them to the same organizer file.

I am currently using this piece of code for the first one. When I use the same for the other piece of code and change the page name it seems to overwrite my previous pushed .png while I want it to append a new page.

topic = spy.workbooks.Topic({'Name': "RPB-4 performance"})
page = topic.document('Stanzer')
page.document.add_image(filename='Stanzer.png',placement='end');
spy.workbooks.push(topic)

Thanks in advance!

Link to comment
Share on other sites

  • Seeq Team

Hi Willem, what that code ends up doing is creating a "blank" Topic object (on the first line) rather than pulling the existing Topic from Seeq. As a result, you'll always be overwriting what the other code pushes.

So do this at the beginning instead:

workbooks = spy.workbooks.pull({'ID': '<id_of_workbook>'})
topic = workbooks['RPB-4 performance']

One thing to note however is that add_image() is going to add on to the existing Topic Document, and so you may get an endless addition of images, which is also probably not what you want.

Is there any way for you to get these two separate pieces of code to execute at the same time?

Link to comment
Share on other sites

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...