I'm trying to use the Google Slides API to create nested bullet points within a paragraph. Currently, I'm able to create a paragraph with bullet points, but I'm struggling to create sub-bullet points (nested bullet points) under existing bullet points.
Here's the current request body I'm using:
{
"requests": [
{
"createParagraphBullets": {
"objectId": "i0",
"textRange": {
"type": "ALL"
},
"bulletPreset": "BULLET_DISC_CIRCLE_SQUARE"
}
},
{
"createParagraphBullets": {
"objectId": "i0",
"textRange": {
"type": "ALL"
},
"bulletPreset": "BULLET_DISC_CIRCLE_SQUARE"
}
}
]
}
How can I modify the above code to create sub bullet points (nested bullet points) under the bullet points created by the first request using the Google Slides API? I tried nestingLevel suggested by ChatGPT but no luck!
ChatGPT result:
{
"requests": [
{
"createParagraphBullets": {
"objectId": "i0",
"textRange": {
"type": "ALL"
},
"bulletPreset": "BULLET_DISC_CIRCLE_SQUARE"
}
},
{
"createParagraphBullets": {
"objectId": "i0",
"textRange": {
"type": "ALL"
},
"bulletPreset": "BULLET_DISC_CIRCLE_SQUARE",
"nestingLevel": 1
}
}
]
}
I believe your goal is as follows.
In this case, how about the following request body? Unfortunately, from your question, I couldn't understand your input situation. So, in this answer, the request body also includes creating a text box and the texts.
Sample request body:
To create the nest list, the tab
\tis used in the inserting text. And also, atcreateParagraphBullets,"type": "ALL"is used. By this, the nest structure is automatically created using\t.The sample curl command using this request body is as follows.
Testing:
When the above request body is used, the following result is obtained.
References: