You can try Dynamically inserting the files url into the API call. Just do a search for ā[table][documentās field]'s Fileās URLā. That should insert the url like you have above. From what I can tell the documents arenāt actually protected by any authentication, so if you sent off that URL to the external tool it should be able to pull it without a problem.
Thatās a great idea and useful knowledge, but it did not solve my problem.
Basically, Iām sending out the text file for analysis and getting results sent back to me and Iām viewing the results in a repeating group (RG).
What I see coming back to me is simply the url://s3.amazonaws.com/appforest_uf/[long _numeric_string]/[filename.txt].
This suggests to me that what is being sent for analysis is not the contents of the text file but the url name of the text file. Not sure why that should beā¦
Hmā¦ As far as I know āuri-argument encodingā is when the URI string doesnāt contain spaces, tabs, or certain other special characters. Below is an example.
Non-encoded:
my text documentās content
Encoded:
my+text+document%27s+content
To me it sounds like they want you to pass the entire contents of the file as an encoded stringā¦ Itās hard to say, though, since Iām not sure which API youāre using.
Iāve tried the method you suggested and am getting an assortment of issues. Parse errors, Bubble errors, and more. Used several online text-encoders to ensure issue was not with encoding provider.
I donāt think this how Alchemy wishes us to proceed? This is meant to be a high-volume API. How could one properly encode all the text blocks efficiently?
In any event - if you could take a look at this Iād really appreciate it. Also, I should clarify: there is a way to send a URL for analysis, which Iāve used with success ( http://www.alchemyapi.com/api/keyword/urls.html ) . The problem is that, while Iāve gotten it to work with 3rd party sites (works like a charm), I canāt get it to work with the content type I need to analyse in my Bubble app.
All the content I wish to parse is in repeating groups. It seems this Url API finds the text it needs to analyze by assessing the HTML tags and proceeding accordingly. It also seems that RGs displayed in Bubble donāt mark the text in the manner needed for the API to do its thing.
So: Basically, I would like to parse content displayed in my Bubble app. Donāt really mind if thatās by using the text API, the url API, or any other method.
So, now Iāve got it working. No encoding required, simple text (normal spacing etc) works.
I think the API might be touchy - I donāt believe I changed anything of note, itās just working now in the way I desire.
However, there is a new problem.
Having gotten the API to work, Iāve jumped ahead a couple of steps and am sending repeating group text from my page to the API. Basically if I limit what I send to āfirst itemā it works. If I send the entire thing I get āParse errorā message from Bubble.
Iāll have to experiment more, but if youāve seen this sort of problem before, please, by all means let me know.
Awesome, glad itās working for you! I canāt say Iāve run into that issue before with the repeating group, but if I think of something Iāll let you know.
I figured this out. I wanted to send text appearing in an RG to an API. The text volumes were initially too large but only via the URL. Sending through the text body enabled it. The thing that tripped me up was I didnāt know was how to trigger the body as a parameter through which to send dynamic data (didnāt even know you could). Some of your posts (elsewhere) helped me through this.
Hi scriptschool, if youāre still reading this thread, could you elaborate a little on your solution? I have a similar need and want to do roughly the following:
allow user to upload csv file via Bubble (goes to S3)
user should take some action that triggers workflow to send the file from S3 to my API (havenāt built it yet but letās pretend it would do some similar analysis like the text service but itāll actually do simple manipulations)
my API should return new data/results to my bubble app to display.
might need to repeat more API calls with this new data (which should be temporary).
Thanks for any pointers. I think conceptually Iām starting to see this is possible but not sure of specifics. How you sent your repeating group text body should be pretty similar to how I send the uploaded file (not just the file url s3.amazon.etc.etc.) to my service. If I can do all this, the rest of my app is essentially adding back-end logic. Iād love for Bubble to handle all else.
The point I was making above was that in the end I did not actually send a text file, I sent text (i.e stored in the DB as text). If thereās a way to send an actual file, I donāt know what it is.
In your case, if you can somehow get the CSV file content into your DB, then you can POST that text as the ābodyā.
If you do figure out how to send the file, post the method here!
Hmm, ok thanks for the quick reply! Iām kind of thinking there is no way to do this with my Bubble front end. That is too bad since I likely need to write my upload UI and backend processing. My questions then become:
is there some way I can use Bubble to manage the usual app stuff: sign-ups, user logons, CSS, some basic app database things, etc. while incorporating my own custom UI and processing in an html area?
this html area needs to be aware of the user logon / user session. Can I pass some kind of token from the rest of my Bubble app to this custom portion of my app?
or is there another way to organize my app to accomplish this goal?
Well, just to clarify, I gave up on the idea b/c the particular API I was using didnāt want a CSV it wanted a text file, and it wouldnāt take a URL so the idea of sending the S3 URL was out.
Furthermore, I did begin looking into putting the file into Dropbox when it is uploaded (instead of/in addition to Bubble/S3), then creating some sort of automation (Zapier, etc.) to send the Dropbox file to the API. But in the end I didnāt fully explore this b/c I found a simpler method (altogether different app design and not pertinent to your question).
So, first of all: are you sure you need to send an actual file to your API? Could you send the data some other way (render it first in HTML, then send the page to the API?)?
Second, what about uploading the file and somehow getting the data into Google Sheets? There are tons of services out there that interact with Google Sheets, perhaps one of these can help you (user uploads file, data is sent to google sheets using 3rd party service or string of services)? Once itās in there you can do almost anything with it (including running it back through your own API).
I wouldnāt give up on Bubble yet for handling all the tasks you need. Generally you can do what you need to with perseverance - the main issue is, is it worth it to you? Some tasks become a bit like a Rube Goldberg machine, which can be a bit unwieldy, but if you have one specific task to do, it can be ok to string a sequence of tasks together. Often, I find that by working through the Rube Goldberg-like approach, you understand the methodology well enough by the end to vastly simplify and have a Eureka moment that vasty simplifies the whole thing into one or two steps.
As for your last question (i.e. if you decide not to attempt the above and you decide to use Bubble for front-end and alternative services for your backend), I canāt help you here as I have not experimented ā but Iāve seen discussion on the forum on these sorts of queries elsewhere. Perhaps youāll find some of them of use (if you search through).
Thanks. I think those approaches could work. Depends on how big the files would get. AFAIK there isnāt a way for the user to load the contents of the CSV to HTML, but Sheets could work. Yeah, it does seem Rube Goldbergish, but I still like it. I want to let my user do a Rube Goldberg sequence of tasks.