How do I store Excel data into Firebase? - excel

I have an Excel sheet of all my data (thousands and thousands of rows). How do I get that "loaded" into Firebase to be used?
I've created a Firebase project and tried to look at some tutorials for the realtime database but that's not quite what I want. I don't want real-time data quite yet. I just want data that I have to be loaded in first. How do I go about doing that?
Thanks!

I figured this out on my own.
First, take the Excel spreadsheet and clean it up in such a way that the first row contains the headers and everything else is the actual data. Remember that Firebase keys (which correspond to column headers) must be UTF-8 encoded which means that it cannot contain . $ # [ ] / or ASCII control characters 0-31 or 127.
Then, save it as a CSV file. For example, on Excel 2013 it would be: File > Export > Change File Type > CSV.
Then, visit various resources online that can do CSV to JSON conversion. The one I used was: http://codebeautify.org/csv-to-xml-json
Finally, take that .json file and load it into the Firebase database. Voila!

STEPS TO UPLOAD COUNTRY LIST IN FIREBASE:
download country list with country code, currency code and currency name what you require:
convert it into csv.
convert csv into json from (https://codebeautify.org/csv-to-xml-json#).
validate json from https://jsonlint.com/
save in a file say test.json.
open firebase with login.
select database.
click on (...) in verticle, beside + - sign,
click on import.
browse and select test.json file
import
now it is great!!!!!!! cheers!

Related

Excel - How to connect to another Excel file?

I have a big spreadsheet(Excel file A) which will be updated every month. Also, I created a parametric search in another Excel file(file B) which can pull data from Excel file A. Therefore, Once I send my parametric search Excel file B to my colleagues, they can always pull the fresh data without updating file B (I would need to update file A monthly to keep data fresh)
I tried to connect data by using Microsoft Query/web data. However, I noticed that if I use web data, the source link changes everytime I update the File A. Therefore, the file B connection won't work.
(I uploaded the file A to JIRA as an attachment. I tried to upload to Sharepoint, but Excel does not recognize Excel file on Sharepoint as an Excel file, it recognize as a html file. Therefore, I gave up using sharepoint)
Is there a better way to achieve what I have described above?
Thanks,
Jennifer.
Since you are using SharePoint, choose From File > From SharePoint folder and input the root URL (e.g. https://companyname.sharepoint.com/sites/workspacename/).
This should give you a dialog box like this once you've logged in:
Click on Edit to open the query editor.
You likely only want one particular file in there, so click on Binary in the row that corresponds to the File A that you should have already uploaded to that space. This will import the Excel file.
Click to expand the Table in the row that corresponds to the table that you want to import. This should be the table you keep up to date that gets loaded in.

How I export my Firebase data in Excel Sheet

I want my Firebase database in Excel sheets. I have all these children: Names, Branch, Batch, College as attributes of all users. I want to export these in Excel Sheets.
Here's an example of items in the database:
And this is how I want the Excel Sheet to look:
Export your firebase to JSON. Just click the settings on the right of your database.
Then, convert the JSON to CSV. There are a lot of csv converter online. You can try https://json-csv.com/. Save the csv and open with Excel.
I would like to explain more Since its unclear to some people.
Step 1. Select Realtime Database (You won't find any download button in Cloud Firestore). for that, Select Database > Realtime Database
Step 2. In there, you'll find a three-dotted button in the right top corner. Select your option (Import/ Export)
In the firebase database, you can see export to JSON file, When you export it download it and then use an online converter to change to excel file.
All the answers here are mentioning online converter tools. You can also use Excel's built-in data importer. I found it useful when I have to export it in a excel table.
Say I have the following data:
Similar like other answers, click the triple dot > Export JSON..
Then, open Excel. Go to Data > Get Data > From File... > From JSON
Then, click on Into Table
Click, Close and Load
Result:

Download SQL results in CSV and PDF

I want to download the results fetched from SQL query in Excel(CSV) and PDF format.
SQL Query
$sql = 'SELECT name, address, phone, city FROM users';
I want this records in CSV and PDF. When user clicks Excel then the Excel file will be downloaded and when clicks PDF then the PDF file will be downloaded.
please help me to do this. Thanks
First, you need to convert the results of the SQL into the format required for each. .CSV is relatively simple as you just need a comma separated list of results and a row separator (\n will work just nicely).
You'll want to set the content-type of the file before returning the result:
header('Content-Type:text/csv');
// code to output sql in csv format here
PDF will require some kind of library like TCPDF: https://tcpdf.org/examples/example_011/
The premise remains the samde though: Make your query then use the results to add rows to the table using the PDF library.
If you are looking for a long term solution, the best option would be to use SQL Server Reporting Services.
The user will have the option to download the result-sets in all the formats you mentioned.

Jira is not recognising my upload from CSV

I'm creating a CSV template for some analysts, they would need to fill it and I then do a bulk upload to Jira.
I want to upload them as defects. The issue I'm facing is:
I have a label when filling out a defect and I want to select one of the options, so for example I have a label called 'Label A' and it has 3 options in a list.
In the excel file I put the top row as 'Label A' and under it for one of the entries I put the full name of one of the options (Displayed on JIRA) for example 'Option A'. But I write this in the excel file as : Option A
But after uploading it does not recognise this and returns a validation error.
This is the same for a tick box label, for e.g. 'Label B'
However any text that I put up, (Something that requires free text and is not a multiple option) like for example 'Summary', I would put any random text e.g. 'abcd', and this will validate fine.
So my question is, what am I doing wrong with the way I'm formatting my CSV for when I upload answers to multiple choice parts of a defect?
I think if you can create a sample issue (like you need to be upload) in jira then you can export(Export all fields) that created issue and analyse the output excel file. then you can understand the input format that jira required form your CSV file.
UPDATED
the other thing you can do is read the JIRA log file it will tell you the actual error occurred some times.
are you export your created issue with this option?..see screenshot below..
The approach will depend on the field types you are using.
For example, if you were loading a simple text field then the text in the CSV file will just be inserted in to the text field.
If, however, you are populating a custom field that is represented by a radio button or a drop-down listbox then you will need to use the field mapping option that is offered during the CSV import.
Say you had a radio button that said either 'true' or 'false'. You would tick the mapping option for this field during the CSV import and configure it to map true -> true and false -> false. You can also do this mapping in the CSV file itself.
You can see more details on this link:
Atlassian - Importing Data from CSV
The approach you can follow is as below:
Count the number of labels in the Issue you are trying to import.
Every label should go into its own separate column for it to be imported properly.
Eg:- If there are 5 labels for an issue, create 5 Labels_CSV(or what suits you) column in the CSV header row and put the 5 labels in the data row.
Once the CSV is created, try to upload it with your existing config file which has mapping for Labels_CSV --> Labels.
Voila, the multiple labels will be imported properly.
Let me know if you have any queries.

How to import xls into Azure Database?

Our database needs to be filled with the zip code for every state in our country, we are provided with a catalog of zip codes in a xls file, we have to import this file to a table in a database hosted in Windows Azure.
I don't know if Stack Overflow allows me to post a link to our xls, but I'll describe the structure of the file:
Every sheet holds the zip code information for a whole state, inside every sheet we have fifteen columns with information such as zip code, type of terrain, type of area, locality, state, city, etc. Every sheet has the same columns and the information inside the cells may contain special characters (i.e. á, é, ó, ú, etc.) normal to Spanish language and this special characters need to be preserved. Also some cell may be empty or not and blank spaces are likely to appear in the contents of the cells (i.e. Villa de Montenegro).
We are looking for a way to import every sheet into our table without losing special characters or skipping empty cells. We have no prior experience doing this kind of task and wanted to know what is the best way to import it.
We tried a suggestion of importing the xls to CSV files and then importing those CSV to our database, but we tried some of the variations of the macro recommended here but the CSV are generated with many errors (Macros aren't our forte).
In short, what is the best way to import our xls to an Azure database table without losing empty cells, special characters nor failing when blank spaces are inside a cell?
I recently had to migrate some data in a similar way. I used the SQL Server 2014 Import and Export Data Wizard. I initially tried with a .csv, but it was finicky about quoted commas and such. When I saved it as a .xlsx file, I was able to upload it without a problem. It's pretty straight forward to use, just select your xls file as the source, configure the connection to your Azure database, next-next-next, and hopefully you get the happy path. I wrote about it on my blog, step by step with screenshots.
We found an easy, although slow, way to copy the contents from an xls using Visual Studio, the version we used was 2012 but it works with 2008 and 2013 too.
Open the Server Explorer.
Add a new connection, the url for the database is required, the credentials are the same as the ones you use to access the database on Azure. Test the connection if you like, if the credentials are correct then you're good to go.
After the connection has been made, expand the Tables section and select the table you wish to dump your data.
Right click and select view table data.
If the table is empty or it has already some data, the workflow is the same. The last record will be empty, select it.
Go to your xls file, for this to work, the number and order of the columns must be the same as the table you will be dumping the data. Select the rows desired, copy them.
Return to Visual Studio, while the last empty row is selected paste the data. The data will start to copy directly into your Azure database.
Depending on your internet connection and the amount of data you're coping, this might take a long time.
This is an easy solution, although not optimal. This works if you don't own SQL Server with all of its tools. Still gotta check if this works on the express edition, will update when I test.

Resources