Bubble.io Bulk Create Data API Setup - Full Walkthrough

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay in this video I'm going to go from start to finish on how to set up the bulk data API to create records at scale so when you might want to use this is it's a more efficient approach than using the schedule API workflow on a list or setting up a recursive workflow it's going to create the records a lot faster and it's going to use less workload units in the process now what I'm going to do is go from start to finish so step one is to come into your API settings and enable the data API now this is a training application that I use uh what I'm going to do as soon as I finish this video is actually disable this data API so that I don't get you guys spamming but you guys want to be careful on who you expose these uh URL end points to the other thing you want to do is you want to generate an API token and use that in the header when you're creating this so I'm going to create a test one now which I'm going to delete after this video so I'm just going to call it test key and what I'm going to do is Expos let's say We'll create let me just look at the data type let's look at a simple one Let's do let's do exercises so what I'm going to do is I'm going to come back to my settings here I'm going to expose exercises now what I'm going to do is copy this data root URL go to the API connector and add a new API call called Bubble data API and what we're going to do is set up a new API call now this is going to be a post call and the data type is going to be text and what we do is that is our URL now the next thing we want to do is tell it which record so this is going to be exercises exercises and then slash bulk now what we're going to do is I'm going to say um bulk create exercises and what I'm going to do is make it raw and we need to add a header saying content type it's going to be text plane and we also need to add an header for our API key um I believe it's just authorization and then Bearer whatever our token is so I'm going to go back to the settings grab the token it's already copied and put that off there now what we're going to do is we're basically going to create the Json structure of this record now exercises we can see here has four Fields I'm just going to do name for now uh and maybe AI so let's try those two so is name of capital it is so cool so we should actually be able to try that let's see what happens not found type not found exercises may have spelled it wrong ah so I spelled it wrong not sure if that's correct spelling or not let's try that there go yeah okay cool let's try that again all right so we can see we got the status as correct so that means we've created the record and if I go it gives you the unique ID there it ends in 9:30 it's also going to be the last one created if we go here we can see it ends in 930 so that's one record now what we have to do to get this to work is essentially send each object that you want to create on a new line so if you can see that creates the number two there that's a new line and the way bubble takes it is one Json object per line so if I was to add it like this I'm going to get an error but if I'm to add it on a new line you'll see it works and it creates both records with the IDS now what I've tried in the past is to copy and paste this and add it in a variable so let's just call it content but what you'll notice is bubble doesn't copy that new line into uh parameters it sends it on the same line and what you're going to get is an error so the way I set this up is set it up with one and actually call this a variable let's call it content and send our singular object check that that works cool now what I'm going to do is go to this test page and show you how you can create this in a workflow so I found you have to do a bit of a work around to do multiple and what I'm also going to do is put a text on the page so you can see what we're dealing with so what I'm going to do is that's my B just G to move that to the side I'm going to add an arbitr text I'm going to call it name Adam and then I'm going to separate it with a percentage sign uh actually yeah let's do that so we have four records there and then what I'm going to do is find and replace um so I'm just pretending you had a list so percentage replace it by an Enter key or a new line and what you should see when I prev this page is we have our line separated objects now what I'm going to do is when bulk and create I'm going to copy that and I'm going to go to bulk create let's just make sure it's an action and I'm going to bul create exercises so you could send this up set this up in a backend workflow and I'm going to so bulk create with four records now what we can see in here how many records have we current currently got 17 there's four I'm just going to delete them all actually be rude this is an application My Friends building some test things in and delete those four records now what I'm going to do is come back here hit Bol create we can run in the debugger can see it's separated and let's see what happened we bulk created all four of our records now this is much quicker than using a regular workflow I believe you can use up to 1,000 lines per bolt create and if you need to pump data into your application this is the most efficient way to do it so I hope that was helpful I know it can be a bit confusing to set this up sometimes so hopefully that makes it easy for you and thanks for watching
Info
Channel: Adam Freelances
Views: 93
Rating: undefined out of 5
Keywords:
Id: lyUBv2XrDMQ
Channel Id: undefined
Length: 7min 13sec (433 seconds)
Published: Wed Apr 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.