I'd like to add a file viewer web part to the home page of my online modern site via an SPFx Part. To try to make things easier, I have a fully configured file viewer part with an Excel file on a different page, and I'd like to use the properties of that part to configure the new part.
Following the procedure as documented here:
newPart["serverProcessedContent"] = templatePart["serverProcessedContent"]; newPart.setProperties(templatePart.propertieJson); page.sections.addControl(newPart); page.save()
Using the debugger, I can see that the serverProcessedContent and propertieJson are both populated correctly. The save() occurs with no error. But the end result after the save is a part that has the properties but not the serverProcessedContent, which is still null. The end result for the user is a file viewer web part that prompts the user to select a file, but the web part properties correctly display the properties from the template part (sheet name, starting cell, etc.)
Any suggestions on how to fully configure a client side file viewer web part via code?