Creating indented bullet points in Google Docs using their API

I’m trying to make nested bullet points in a Google Doc using the API. My goal is to turn a simple list into something with subitems. For example:

• Main point
    ◦ Subpoint

I’ve looked at the CreateParagraphBulletRequest but it doesn’t have an option for indentation. The docs mention something about counting tabs but that’s not working for me.

When I try to add tabs with InsertTextRequest, it just puts the tab character at the start of the line instead of indenting the bullet.

• Main point
•     Subpoint

This isn’t what I want. Does anyone know how to properly indent bullets using the Google Docs API? I’m stuck and could use some help!

I’ve encountered this issue before when working with the Google Docs API. The key is to use the ‘indentStart’ property within the ‘ParagraphStyle’ object. Here’s what worked for me:

  1. Create your bullet point using ‘CreateParagraphBulletRequest’.
  2. Then, apply an ‘UpdateParagraphStyleRequest’ to the same range.
  3. In the ‘ParagraphStyle’, set ‘indentStart’ to a positive value (in points).

This approach should correctly indent your subpoints. Remember to adjust the indentation value as needed for your specific layout. It took some trial and error, but this method consistently produced the nested bullet structure I was aiming for.

I’ve dealt with this exact problem in a project recently. What worked for me was combining the ‘CreateParagraphBulletRequest’ with ‘UpdateParagraphStyleRequest’, but with a twist. Instead of using ‘indentStart’, I found success with the ‘indentFirstLine’ property in the ‘ParagraphStyle’.

Here’s the trick: set ‘indentFirstLine’ to a negative value and ‘indentStart’ to a positive one. This creates that perfect nested bullet look. For example, -18 for ‘indentFirstLine’ and 36 for ‘indentStart’ worked well in my case.

Also, don’t forget to adjust the ‘nestingLevel’ in your ‘CreateParagraphBulletRequest’. This ensures the bullet style changes appropriately for subpoints.

It’s a bit counterintuitive at first, but once you get the hang of it, you can create beautifully nested bullet points programmatically. Good luck with your project!

hey ethan, i ran into this too. what worked 4 me was using ‘indentFirstLine’ and ‘indentStart’ together in ParagraphStyle. set ‘indentFirstLine’ negative and ‘indentStart’ positive. play with the values til it looks right. also, don’t forget to set ‘nestingLevel’ in CreateParagraphBulletRequest for proper formatting. goodluck!