Hi, I have the start of an app that enables me to scan a QR Code and store the data in a list, then export to local storage on Android as a CSV file.
The issue I'm having, is that each line in the list that is exported into the CSV, starts and ends with " (inverted commas) which prevents the data from appearing in columns.
Is there a way I can get the data to export without the "?
I can't get a Do It result to show anything. I click Do It on the Export Blocks and the file is created on my phone but no data is shown on the PC screen
You are using two different tags to store your data:
an empty text (is this even legal?)
the fixed text value ',First Name,Last Name,Division' (That leading comma os probably trouble.)
You get from the blank tag, add new items to it, then store to the second tag.
So you lose whatever you had added on a previous run.
Then you loop through all the tags, assming each associated is a list with 1 item, to build an export text.
You write the text to a file, then try to read it back before it has finished the write operation. (look through the File events. They are there for a reason.)
I can't vouch for the /Download/ location. I prefer to use the share component for my exports.
Hi ABG,
Thank for the reply. That preceeding , has been removed. It was only there to see if it made a difference when opening the CSV file with Google Sheets (but it didn't).
The fixed text vale 'First Name,Last Name,Division' is there in the hope of adding Headers to the CSV file, which are required by the App I'm going to need to import the CSV into after all the works correctly.
The share component might be a better option in the long run, but I'm not sure the App I'll need to import to will support that.
Just trying to get a working CSV file before anything.
Thanks
avoided tag typos by using a constant global variable
delayed announcing file write success until its completion event
removed the read back code. It would have never worked in its location, and you've got TinyDB anyway.
used Create Empty List as the TinyDB Not Found default for the list of scans, avoiding poisoning of list operations with text blank where expecting a list.
ABG Thank you. That fixes the issue and the CSV file is created and recognised properly. Thank you!
I'm going to compare the 2 aia files to try and get my head around the difference. Where was I tripping myself up with the tags? I'm sure I'll see when I compare.
Thank you again for you help the other night. Much appreciated!
I'm now trying to have a screen where data can be manually entered into a text box (hoping to be textboxes once 1 in working), and then store that data into TinyDB, so that when switching back to Screen1, the data is in the list and able to be exported.
I've tried for hours, trying to find content on this to assist, but I just can't put anything together that remotely works. Could I please pick your brain again?
It's creating a CSV file of data that can be imported into a registration list of another app that doesn't support QR Code scanning, and has a confusing and messy UI for some older generations to fill out.
I'm trying to make the registration process for them as simple as possible. QR Code scanning is perfect for them, but I know sometimes they'll forget their card with the QR printed on it, so basic, non-messy manual registration on Screen2 would be their backup. Like when face recognition on my phone doesn't work, i can still enter my PIN
This way, I can have them register, via QR or manually, then I can export to CSV, and import into the required app
P.S. I did not bother to check for embedded commas in the names, that would foul up later parsing ("Bond, James Bond"). A text replace comma with empty text would fix that.