English 中文(简体)
国家预防机制“google-spreadsheet”格式,配制了由“addRows”增加的价值。
原标题:NPM "google-spreadsheet" formatting a value added by .addRows()

I m 采用国家预防机制的“google-spreadsheet”项目。

When I add some rows with the .addRows() command, sometimes the format is converted by Google sheet (like phone number). I would like to add the values with the format I wanted ;)

这是我法典的摘录。

我想在文字中写到,电话栏号——号码应是纯文本。

const { GoogleSpreadsheet } = require( google-spreadsheet );
const GS_creds= require( ../xxxxxx.json );
const GS_concertannuel = new GoogleSpreadsheet( yyyyyyyyy );
await GS_concertannuel.useServiceAccountAuth(GS_creds);
await GS_concertannuel.loadInfo();
const GS_CA_tab_hebergements = GS_concertannuel.sheetsByTitle[ hebergements ];
const ajout_gs_hebergements = GS_CA_tab_hebergements.addRows([{
                 identifiant : myIdentifiant,
                 phone_number : myPhoneNumber // 0909090909
            }]);

一、导言

INPUT: 我在数据库中的电话号码是0909090909

OUTPUT : The phone number copied in the Google Sheet with google-spreadsheet is 909090909 (without the first 0). The OUTPUT I would like is 0909090909, that means in string format and not number.

I read the documentation, but I don t understand. (https://theoephraim.github.io/node-google-spreadsheet/#/).

尽管有广告 “最受欢迎的谷歌谢斯普西特/字母”文本,我没有在互联网上找到许多信息。

我可以尝试过国际仲裁机构。 我先是奶粉;

谢谢你。

问题回答

In your situation, as a simple modification, how about the following modification?

From:

const ajout_gs_hebergements = GS_CA_tab_hebergements.addRows([{
                 identifiant : myIdentifiant,
                 phone_number : myPhoneNumber // 0909090909
            }]);

To:

const ajout_gs_hebergements = GS_CA_tab_hebergements.addRows(
   [
     {
       identifiant: myIdentifiant,
       phone_number: myPhoneNumber, // 0909090909
     },
   ],
   { raw: true }
 );

const ajout_gs_hebergements = GS_CA_tab_hebergements.addRows(
   [
     {
       identifiant: myIdentifiant,
       phone_number: " " + myPhoneNumber, // 0909090909
     },
   ]
 );
  • I thought that the reason f或 your current issue is due to By this modification, the value is put as a text.

Reference:





相关问题
get atom feed and display in html (google-api)

Can someone help me out on this. I have a problem with the return results from an google-api call I want to echo them back as html, but firefox keeps displaying a feed page. In IE, I get an error ...

Using Google App Engine With My Dreamhost Registered Domain

I have registered a domain example.com using dreamhost, and currently have a standard wordpress blog set up on www.example.com. I d like to have appengine.example.com point to my Google Appengine ...

google calendar java api

I have an object of CalendarEntry I know that http://www.google.com/calendar/feeds/example@gmail.com/allcalendars/full is the feed url of all calendars but how I can get this feed url from ...

Google API for Internationalization + asp.net

Hai guys, Is there any google api for Internationalization with asp.net or any other open source api for it because i want my users to view my site in multiple indian languages like tamil,malayalam,...

google API translate, only a div into page

I have an HTML page, and I would use Google Translate to translate only a div into my page. <div id="google_translate_element"></div><script> function googleTranslateElementInit() { ...

How to use doctest on a Client script?

I am playing with Google Calendar API, creating some useful function. I another hand, I want to do it right puting some useful doctest and starting agile development. How to write doctest since the ...

using google.loader.ClientLocation

what will be best way to use using google.loader.ClientLocation to get client country & city name in jquery Thanks

热门标签