EMBEDDED URL TO TEXT ON CHAT MESSAGE

24 views
Skip to first unread message

Duya

unread,
Sep 7, 2023, 10:41:48 PM9/7/23
to Google Apps Script Community
Hi, there.

I am hoping you are doing well.

I am currently having a concern on te following problem.

What script I want to make;
- Get a data table from spreadsheet
- using 'forEach', create a text with embedding google form link that 'id' is prefilled and send a chat

Multiple challenges did not come good unfortunately although the following sample script I made was successful.

function sample(){
  const url = '<https://docs.google.com/forms/d/e/xxx/viewform?usp=pp_url&entry.1181110482=00003977|url>';

  const options = {
      'method' : 'POST',
      'headers' : { 'Content-Type' : 'application/json; charset=UTF-8' },
      'payload' : JSON.stringify({'text' : url}),
      'muteHttpExceptions' : true
    };

    Utilities.sleep(300);
    const result = UrlFetchApp.fetch('xxx', options);

Thank you for your support in advance.

スクリーンショット 2023-09-08 11.29.16.png

スクリーンショット 2023-09-08 11.28.12.png  

Duya

unread,
Sep 7, 2023, 10:51:25 PM9/7/23
to Google Apps Script Community
Just to add,

When I created the text, I put ``` at both front and end of the text

Reply all
Reply to author
Forward
0 new messages