When a User donates they are returned to my thank you page with their donationID in the URL.
If I set Bubble up as below I get the API response fields correctly showing after I click Initialise call and all the response fields correctly show in my Workflow using Get data from external API.
but when I create a Workflow new donation from Get data in page URL and use the API to retrieve data it assigns incorrect data to the donationID (maybe the actual data from the sample donationID in the GET?)
but if I’m not supposed to put a sample donationID into the API request, and it won’t accept an empty parameter, what do I put in the Bubble parameter Value field?
@cowontherun you’d use the sample donation id to initiaze the GET and choose how you wish to save the responses into you DB. once youve done that you’d then pass it the actual Donation ID unless ive miss understood your Question
on page load youve got a GET DonationID from page URL but only when its emply…so there is NO Donation ID… if youve got no Donation ID and and are making the GET to the API endpoint…youll get nothing back so youre set 2 if going to fail as there is nothing to save…
Should it not be that on pgae load youve passed the DOnation ID…you read that as not emptiy…make your call and save stuff
why when the Donation ID is empty are your creating something…thats my point. for debugging change that to give you a notification or similar
i take it youve unchecked the private checkbox in your api endpoint… what does your logs show? also do a little check with an input or similar to read the Donation ID from the URL to make sure it working… ive alwatys struggled with anything upper case as an agrument.
Ok I unchecked private but it is still not pulling the right details back for the donation id.
For example in the top row below, the donation ID is correct, it shows in the URL and saves to the db. But I actually donated $5 not $2.10 and donated to a completely different CharityID. It’s like the API does not know which donationID to pull back the details for and I’m not sure how to tell it. It seems to be pulling back the details for the donation in the row below before it. I don’t have to do anything with the other API settings in Bubble do I such as the ‘Expose Data API checkbox’?
hmmm bit confused…your workflow looks like from the screen shot your creating something in the first step and updating that thing in the second step… where as you comments above indicating your updating an existing thing…which is it…
in regard to your DB… is the result of your wf creating a thing or updaing an existing thing
Oh so I create the donation id in the db first (Create new donation) and then I update that donation id with the details the API pulls back (update step 1).
So the db will save the donation id first and then I update that id thing with the other donation details from the API after. (I also tried putting the API fields when creating at step 1 but it still pulled back the wrong details for that donation id).
I think the problem might be that the api doesn’t know which donation id details i want - i tell Bubble to save the API donation details against the step 1 id but how does the API know to fetch the donation details for that particular id and not any other id?
ok…following the logic now…the DB will know which thing to update in the second step due to the fact its referencing the thing in the first step.
hazarding a guess here…are the updates always the same menaing the amount is always 2.1 etc etc
have you tested in POSTman you can run that from their API docs
The details are always from an older donation eg. $2.10 unless I go back to the API plugin and put in the most recent donation id and click the Modify Call Types button.
If I then use the most recent donation id in the url again, the workflow now returns the correct most recent donation details for that id ($5)
This tells me that the workflow seems to literally use the sample donation id in the initialise call instead of the most recent id in the url.
At first I thought maybe the API was just slow and maybe I should wait a few minutes before requesting the donation details for the ID but nope, it will never return the most recent details.
I’ve also changed my original api set up above to the below but it still uses the actual id in the value field.
@cowontherun on the workflow step ‘make changes to donation…’, where it has Amount = …
Click on the ‘Just Giving API - Get Donation Details’ and it should open up another properties box to enter the donationId, which hopefully you can specify as a result of step 1’s field.
Each time you use the API you’ll need to enter this parameter value, i.e. in each of the four times it is called. As long as the parameter is identical, the page will cache the value from the first call and use it in the others.
Using the API result in multiple places is slightly better if it is defined as a workflow ‘action’ instead of ‘data’, so you can have one step to call the API with its parameters, then where you want to use it, refer to the step’s result. This means setting up the parameters in just one place instead of having to do it in four places.
I think Huntsmen were gifted to us purely for entertainment value. I can relate to being freaked out, I had an intimate moment with one, looking out past its hairy legs on the inside of a motorbike helmet. My frozen stiff body was likely a big help to my brother’s cornering.
Holy cow I think that’s the worst story I’ve heard! Your brother must have thought you were the best pillion passenger. My top one was when a Huntsman flew off the ceiling fan and into my friend’s lap. I stopped laughing about an hour later. He was laughing too but more in a hysterical, screaming, about to have a nervous breakdown kind of way.