I am trying to change the text displayed in the textbox after adding visual. See code below.
Based on the documentation I can only interact with the Visual Properties or Data Fields.
The textbox visual does not have any data roles when I am running getCapabilities() on it. In the visual properties list, the titleText seems to be the property I am looking for, but it does not change anything.
To give some context why I need this. I am trying to build a form, where I can add extra visuals to an already existing PowerBI report, and I need the abilty to also set some basic formatted text there to have a nicely looking layout
const pages = await report?.getPages()
const activePage = pages?.filter(function (page: any) {
return page.isActive
})[0]
const visualResponse = await activePage?.createVisual(
'textbox',
{
displayState: {
mode: models.VisualContainerDisplayMode.Visible,
},
height: 100,
width: 100,
x: 100,
y: 100,
},
true,
)
visualResponse?.visual.setProperty(
{
objectName: 'title',
propertyName: 'titleText',
},
{
value: 'Some text to display',
},
)