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.
function getGemExchange() {
// 1. Get a Firestore instance
const firestore = getFirestore()
// 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)
})
}
It all works fine except the values have its data type with it.
status taxAmount bankDetails gemAmount uniqueId serviceFee
{stringValue=PENDING} {doubleValue=0.02} {stringValue=U2FsdGVkX1/a2sX4CaKi0Ham/dSSEzlg7QNca236+clZbRDwHZwe8C7Xhy53ybk0c6l34CLYtQ+0KFnDOuAAfUc4WUKRfQTPWxS8NDHP2kREeRzX2BJGZ6JpL3NfxmsbR/dGpvKqy/Pa+Of3guJmjg==} {integerValue=33} {stringValue=APR-TC0} {integerValue=2}
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?