How to obtain the tag of cell?

Do you want to: Suggest a feature
Document Server version: 8.2 Community Edition

For example, as shown in the figure below, I have three cells. I tried to obtain the tag of the first cell using the following code according to the Office API.
The result is not a function.

let oDocument = Api.GetDocument();

let oTable = oDocument.GetAllTablesOnPage(0)[0];

let oTableCell = oTable.GetCell(0,0). GetContent(). GetElement(0). GetTag();

console.log("oTableCell", oTableCell);
// oTable. GetCell(...). GetContent(...). GetElement(...). GetTag is not a function

There are even more strange issues, such as the image I uploaded, where you can see that the third cell is an image.
I can use version 7.1

oTable.GetCell(0,2). GetContent(). GetElement(0). GetTag();

Retrieve the tag of the image
But after updating to 8.2, it also became

oTable.GetCell(...). GetContent(...). GetElement(...). GetTag is not a function

How can I obtain the tag of a cell in version 8.2?

Hello @yingyu

I’ve received the same result on version 7.1. Could you specify what is returned in your case?
In general, GetTag method is available for ApiInlineLvlSdt and ApiBlockLvlSdt elements which are Content Controls.

Before you replied to me, I already knew what the problem was and how to solve it. Your answer confirmed the issue. Inserting text into the document only creates a Paragraph. To use GetTag in a cell, you must first create an InlineLvlSdt or BlockLvlSdt.

I have a suggestion: your current documentation is very poor! Whether it’s the code examples or written tutorials, they often lack context and only cover the middle parts. This has left me unclear about the scenarios in which GetTag can be used. I can only explore it one by one through code suggestions in the macros, which is very time-consuming! I hope you can make the documentation more detailed.

Thank you for your support!

Thanks for the feedback. We are always improving documentation, actually, there is beta version of API available, you can check it out too.

Since problem is now resolved, closing the topic.