currently I use a button to creat a PDF from pagedesign.
Is it possible to write an JavaScript code, that “clicks the button” and build it in an automation, that is activated if the data meets a specific condition?
If it is possible, what would the code look like? (I have limited knowledge in programming)
That is not possible. Javascript is executed in the browser, python is executed on the server.
Therefore, Javascript can not be executed by an automation.