function getGemExchange() {
// 1. Get a Firestore instance
const firestore = FirestoreApp.getFirestore(email, key, projectId);
// 2. Get a collection from Firestore
const userDocuments = firestore.getDocuments('gemExchangeRequests').map(document => document.fields)
// 3. Get the first document from the collection
const first = userDocuments[0];
const columns = Object.keys(first);
const sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow(columns);
// 4. Turn each document into an array to be appended to the sheet
userDocuments.forEach(document => {
const row = columns.map(column => document[column])
sheet.appendRow(row)
})
}
Explain the Problem in Detail
0
I'm using Google App Scripts and Firestore GoogleAppScripts for data fetching from firestore to google sheet as explained on this library.
Here's my code.
It all works fine except the values have its data type with it.
So I want to get rid of data types such as "stringValue", "integerValue" or "doubleValue" on my Google Spreadsheet.
For example, I want "PENDING" for the "status" column, not "{stringValue=PENDING}"
Minimal Code to Reproduce the Problem
Explain the Problem in Detail
0
I'm using Google App Scripts and Firestore GoogleAppScripts for data fetching from firestore to google sheet as explained on this library.
Here's my code.
It all works fine except the values have its data type with it.
So I want to get rid of data types such as "stringValue", "integerValue" or "doubleValue" on my Google Spreadsheet.
For example, I want "PENDING" for the "status" column, not "{stringValue=PENDING}"
What should I do in this case?
Other Comments
Library Version: