Hello, I am trying to build a tool that interfaces with Microsoft Graph API, I have gotten the API working and it responds to my request with a Base64 encoded CSV file. I have gotten the data decoded and outputting using transformers and when I try and insert it into a table the table just stays as empty. The string works when I just paste it into a txt file and change it into a CSV file so im unsure why Retool doesn't recognize it as a CSV or what I am doing wrong. Thank you in advance!
@SycloneCarson Welcome to the forum!
Can you share a screenshot of what the data looks like as a result of the transformer and how you are populating the table component?
Hey @ScottR I have uploaded the images of the data before and after transformer and the second includes the data field for the table. Thank you!
I guess the only thing I am unclear about is why the MS Graph API sends back a CSV.
Seems to me that would need to then download the CSV and store it somewhere (Google sheets) else to read from it into a table...that's my initial thought.... I don't have experience with the MS Graph API at all.
Check this out
https://docs.retool.com/docs/javascript-api-reference#utilsdownloadfile
The API Responds with an encoded CSV Binary string. How do I load a CSV string into a table tho?
I got it figured out, I needed to convert the CSV into JSON and I used the code found: here, from Stack Overflow. My new question is, How do I format the number in a table as Bytes, KiloBytes, Megabytes, and Gigabytes?
That's awesome. Can you share the JSON? Or some of it? Or a screenshot of the table?
You want to convert the Storages Used column from bytes to....? sorry trying to follow
The previous reply suggesting Numbro worked for me with the following code attached to the Display: Value category on the table.
{{ currentRow['Storage Used (Byte)'] / currentRow['Prohibit Send Quota (Byte)']}}
I wanted the displayed value to be converted to 500 KiB vs 500000 (Bytes)