Google sheets value to microsoft teams

hi!

I want:
when I select (received) in column K of my sheets table,
its send the values ​​of column A and D of this row in microsoft teams
with the mention (part received).

my script sheets:

function onEdit(e) {
  var sheet = e.source.getActiveSheet();
  var range = e.range;
  
  // Vérifie si l'édition a été effectuée dans la colonne K et contient les mots "REÇU" ou "REÇU PP"
  if (range.getColumn() == 11 && (range.getValue() == "REÇU" || range.getValue() == "REÇU PP")) {
    var row = range.getRow();
    var valueA = sheet.getRange("A" + row).getValue();
    var valueD = sheet.getRange("D" + row).getValue();
    
    // Envoie les valeurs à Pipedream via le webhook
    sendToPipedreamWebhook(valueA, valueD);
  }
}

function sendToPipedreamWebhook(valueA, valueD) {
  // Remplacez l'URL du webhook Pipedream ci-dessous par votre propre URL
  var webhookUrl = "url pipedream*****";
  
 // Créez les données à envoyer
  var payload = {
    "text": "Valeur de la colonne A : " + valueA + "\nValeur de la colonne D : " + valueD
  };
  
  // Envoie la requête POST au webhook
  var options = {
    "method": "post",
    "contentType": "application/json",
    "payload": JSON.stringify(payload)
  };
  
  UrlFetchApp.fetch(webhookUrl, options);
}

sorry for the translation, I use google :slight_smile:

with pipedream I tried to obtain http / webhook and send to messsage from microsft teams but it does not work. It just sends the message I wrote in send to message microsoft teams… Anyone have a little idea to help me?

Hi @piecesccb,

You’ll need to update the part to actual Pipedream HTTP endpoint that you have created

  var webhookUrl = "url pipedream*****";

hi
yes it was already done
var webhookUrl = “https://eo11g8a*****zq.m.pipedream.net”;
I concealed the information.

it’s at pipdream don’t understand how to configure it :frowning: