Script Automation appsheet align colons text

88 views Asked by At

I have an Appsheet who consist of many columns. Then in appsheet, i have already created automation and can call a script. Before that, i created appscript who purpose sent notification messages to Line-notify automatically. The script like this.

function sendLineNotify(message, token) {
  var formattedMessage = message.replace(/\\n/g, '\n'); // Replace '\n' with actual line breaks
  var formData = {
    'message': '\n' + formattedMessage,
  };

  var options = {
    'method': 'post',
    'payload': formData,
    'headers': {
      'Authorization': 'Bearer ' + token,
    },
  };

  UrlFetchApp.fetch('https://notify-api.line.me/api/notify', options);
}

Script is worked, but in messages, all colons cannot align. i already use space manually to make colons align but there are several colons in lines messages cannot align.

For information, In automation appsheet, i have created function parameter: messageas as following.

concatenate(
  [Sampling Date], " ", [Time], "\n";
  "\n";
  "==========================", "\n";
  "\n";
  "Chlorine\n";
  "*STD Raw Pool dan Soft Pool (2-4 ppm)\n";
  "*STD ACF dan SWT UV (0.2 ppm)\n"; 
  "\n";
  "*Chlorine\n";
  "- RWP         : "; [Raw Water Pool Chlorine]; " ppm\n";
  "- SWP         : "; [Softener Pool Chlorine]; " ppm\n";
  "- ACF "; [ACF Type];"      : "; [ACF Chlorine - OPRP]; " ppm\n";
  "- SWT UV   : "; [Soft Water Chlorine]; " ppm\n";
  "\n";
  "*KLORIN TANK : "; [Kadar Chlorine tank]; "\n"; 
  "\n";
  "*Conductivity\n";
  "- RWP              : "; [Raw Water Pool Conduct]; " μS\n";
  "- SWP              : "; [Softener Pool Conduct]; " μS\n";
  "- Softener "; [Softener Type]; "    : "; [Softener Conduct]; " μS\n";
  "- SWT UV        : "; [Soft Water Conduct]; " μS\n";
  "\n";
  "*Hardness\n";
  "- RWP              : "; [Raw Water Pool Hardness]; " ppm\n";
  "- Softener "; [Softener Type]; "    : "; [Softener Hardness]; " ppm\n";
  "- SWT UV        : "; [Soft Water Hardness]; " ppm\n";
  "\n";
  "*Turbidity\n";
  "- Sand Filter "; [Sand Filter Type]; "  : "; [Sand Filter (C) Turbid]; " NTU\n";
  "- SWP                 : "; [Softener Pool Turbid]; " NTU\n";
  "- Softener"; " "; [Softener Type]; "      : "; [Softener Turbid]; " NTU\n";
  "- ACF ";[ACF Type]; "              : "; [ACF Turbid]; " NTU\n";
  "- SWT UV           : "; [Soft Water Turbid]; " NTU\n";
  "\n";
  "*Chloride\n";
  "- RWP         : "; [Raw Water Pool Chloride]; " ppm\n";
  "- SWT UV   : "; [Soft Water Chloride]; " ppm\n";
  "\n";
  "=========================="; "\n";
  "\n";
  "Inspector : "; [Inspector]; "\n";
  "Notes : \n";
  [Remark])

This is example messages notification after automation appsheet is used, The condition if all column in appsheet is all filled. Does anyone know how to solve this problem? Please let me know.

enter image description here

0

There are 0 answers