Search code examples
google-apps-scriptgoogle-docs-api

How to insert RichLink (Chip Block) in Google Docs using Google App Script


enter image description here

Google Docs has recently introduced a feature where we can refer to

  • Date
  • Person
  • Google Drive Document

in the form of a Chip Block (as shown in the picture above). The Document-A already exists in Google Drive.

Currently the only way to generate such Chip Block is to manually hover the document link and then click Replace URL - Chip in the pop up modal that appears.

I am trying to generate such chip block using Google App Script but have not been successful so far.

Rich Link Documentation does not have any code snippet or method to add a Rich Link inside a document.

Document Service page also doesn't have detail regarding how to insert a Rich Link.

I wonder whether the feature is not yet implemented in the Google App Script Api

EDIT

As mentioned by Stephen Shaw this issue has been flagged on Google Issue Tracker Create and insert smart chips by maclir. Hoping for an early implementation of this feature.


Solution

  • The smart chips can be retrieved using the methods released on August 23, 2021. Ref. But, unfortunately, in the current stage, it seems that there are no methods for inserting the smart chips. Although I checked about this at both Google Document service and Google Docs API, I couldn't find the methods for this. So, I think that is the current answer.

    And also, when I checked the Google issue tracker, I couldn't find anything about your goal. Ref So, how about reporting your goal as a future request at the issue tracker?