I found a code that I linked to a button so that, when clicking it, a message is sent in Slack. So far I was only able to have that message within the code itself, as in here:
function sendNotification() {
const url = "https://hooks.slack.com/services/"
const params = {
method: "post",
contentType: "application/json",
payload: JSON.stringify({
"text":"Hello, World!"
})
}
const sendMsg = UrlFetchApp.fetch(url, params)
var respCode = sendMsg.getResponseCode()
Logger.log(sendMsg)
Logger.log(respCode)
}
However, what I would want it to do is to grab the text from a cell, and send that as the message. Also, I don´t know if this would change anything, but the message in the cell comes up as the result of a formula un that cell, so it is the text that needs to go through, but not the formula.
If someone could help with this that would be awesome! TIA!