react native com google sheets
Gorkes
Posted on September 1, 2020
Preciso colocar o retorno em uma variável para exibir outro componente, só estou conseguindo visualizar o retorno no console.log
const GoogleSpreadsheet = require ('google-spreadsheet')
const credentials = require('./src/credentials.json')
const { promisify } = require('util')
const docId = '1RPWKohhPnHwoH78wrU0VtSaW_zj91kW_oKrAdWktLjY'
const accessSheet = async() => {
const doc = new GoogleSpreadsheet(docId)
await promisify(doc.useServiceAccountAuth)(credentials)
const info = await promisify(doc.getInfo)()
const worksheet = info.worksheets[0]
// select row
const rows = await promisify(worksheet.getRows)({
query: 'imei = 121545465456'
})
rows.forEach(row => {
console.log(row.status)
})
}
accessSheet()
Posted on September 1, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.