Hi! I’d love to help – Are ALL of the values formatted as 2.500? Or are you saying there’s a mix of both 2.500 and 2,500?
The “extract with regex” is an option built into bubble. Wherever you want to use the text, you can select “jsonTable A’s data –> Extract with Regex”.
Thanks! As I have users around the world, CSV files can come in different formats, as some countries adopt 0,000.00 and others 0.000,00
But a file will come with a numeric format, it won’t come mixed up.
If you have a mix of both formats in the same CSV file, that’s bit trickier to handle - but if the CSV is only using one at a time, you can set the “mask” value to use the 0.000,00 format. Check out this section of the docs to see if that is enough to solve the problem.
I’m guessing there’s something more to the issue, but just want to make sure you saw that first.
I tried again now, it even matches, but even so the 1.500 was converted into 1.50
Actually… there’s also a hidden option called “decimal” that I never added to the docs. This allows you to use a regular number mask, and change the decimal type (in this case, you can change it to a comma). Still not sure if it’ll solve it, but I’ll add this to the docs as well.
Example:
{
"id": "hp",
"header": "HP",
"order": 5,
"type": "text",
"mask": "0",
"decimal": ","
},
Try adding that “decimal” field to that exact setup, and I think it should work!
Unfortunately it didn’t work.
If I put only 0 in the mask, it rounds the number and returns 2
Curious that even putting the column of type text, but without masks, it should accept 1,500 and, even typing directly, it converts to 1.5
Hmm, I tried testing it out in the example page, and this is what it looked like for me - is this the result you’re trying to get on your app? [link removed]
Exactly!
Cool! Try copying those settings in the video - let me know if that doesn’t work!
Sorry! I dismembered everything to see the result of each process and I noticed that the plugin 1T - CSV UPloader that I use to transform the data into JSON that is converting the number 1,500 to 1.5, so your plugin will not be able to correct that. I will analyze with them
Ah that’ll do it! Best of luck
@DevoPanda Hey I’m not sure if I’m doing something wrong but the table isnt showing up on my editor.
I’ve got this in the Column JSON:
[
{
“id”: “firstName”,
“header”: “First name”,
“order”: 1,
“type”: “text”,
“columnWidth”: 200
},
{
“id”: “lastName”,
“header”: “Last name”,
“order”: 2,
“type”: “text”,
“columnWidth”: 200
},
{
“id”: “email”,
“header”: “email”,
“order”: 3,
“type”: “text”,
“columnWidth”: 250
},
{
“id”: “rate”,
“header”: “Rate”,
“order”: 4,
“type”: “text”,
“columnWidth”: 150
},
]
and the table just shows your panda logo. Can you explain why?
Thanks in advance
Hey! It looks like your issue might be the quotes - those are formatted quotes, which will break the json. Try replacing your JSON with the settings below:
[ { "id": "firstName", "header": "First name", "order": 1, "type": "text", "columnWidth": 200 }, { "id": "lastName", "header": "Last name", "order": 2, "type": "text", "columnWidth": 200 }, { "id": "email", "header": "email", "order": 3, "type": "text", "columnWidth": 250 }, { "id": "rate", "header": "Rate", "order": 4, "type": "text", "columnWidth": 150 } ]
Hi there, great work on this plugin.
Question: Can I populate a table with financial data from an API call (basic stock price information).
Can I then assign certain cells to perform math on other cells that were populated from that call?
Then, can I reference those cells specifically to store in a custom state, or write directly to the DB?
Thanks for your work.
Best regards,
Dan
Hmm, the panda logo will always show on in the editor. What does your table look like if you preview the actual live site?
@underhill.dan Hey! It looks like this could be a bit complicated, but the plugin is quite flexible under the hood, and I’m actually very interested in helping you make this work.
- Populating the column with data from an API should be quite straight forward. This might vary based on what else you want to populate, but I’m assuming the results of the API call are formatted as JSON, which means you can set the “Json data” field as “Get data from external API” and use your stock info. I’m happy to help more on this too if you have other requests!
- Actually, yes! Though it’s not shown in the documentation, you can actually use some math by setting the value of the field to any Javascript formula. For example, something like:
=A1*A2
or even=SUM(B1:B8)
or=ROUND(SUM(C1:C8), 2)
. If you let me know the specifics on what you need to calculate, I’ll be able to help more here as well. - To export the data afterwards, your best bet might be to extract the JSON result with regex, which is similar to what I did in the example here. I might try to add an easier way to export just one column though, since a few other have had the same request.
Again, let me know some more details on what your API results look like, what else you want to add to the table, and what you want to end up using the data for. I’ll be happy to help figure this one out!
Hi @DevoPanda
Thanks for getting back to me. Some of the items that I am working on are proprietary so I can’t go into detail here (yet), but I’d be delighted to talk more about this offline if you want to PM me.
Currently we have an app that crunches through a tremendous amount of math based on the input of several JSON calls for historical financial data. We’ve gotten it to the point where the time spent crunching the math is less than 2 seconds which is OK. But many of those equations are fixed and there are some limitations to what we can fully do. We built the prototype of the math in Excel, and the benefits of being able to crunch math in that type of motif would hopefully allow us to make changes, and more importantly, additions on the fly, for example by utilizing another cell that computes a different information based on the original JSON input. In other words, “ooh, let’s add a new cell that takes this other bit of information and divides it by X” or whatever." And then grab that cell’s information and drop it into a custom state.
In Excel, it’s easy to do. But with the chains of math we built in Bubble, it’s much harder to just insert this type of thing on the fly.
Right now, to add some new “feature” related to the math can get lengthly and difficult. Working from an Excel-like table could make the future editions and revisions of blocks of math much easier. I’m happy to share more privately if you like.
Best regards,
Dan