Fetch Column

Current Location works, too!

6 Likes

Wow! Did not know you could do that.

3 Likes

Right but I would try to return an array with all values and later using Single Value columns, choose and show the wished values reading the item position in array. This will apply in cases where I want to retrieve more than 4-5 values from JSON payload.

But, we have to modify/improve the David’s column/script to get an array. :facepunch:

Nice to see these ideas over here!.

1 Like

David’s JSON Transform column would do that. You pull in the entire JSON string which contains all of the values, and then pick out what you need using the transform column, just like you can with an array and single value columns. The JSON Transform is a lot safer since you don’t need to assume the position of data in the JSON strings. Instead it queries it like an object, as opposed to reading through it like an array. You can still perform a single api call to get the entire json, but have as many transform columns as you need to parse out the data you need.

1 Like

Yes!.. thinking it better, one can put several values separated by comma or slash and get an array using a Split Text column later:
E.g:

.[0].lat + "/" + .[0].lon + "/" + .[0].temp + "/" + .[1].temp + "/" + .[1].cityname

Saludos!

5 Likes

Ahh, I see what you’re saying. Yeah, that would work pretty good. You still have control over the number of elements in the array and what they are. That’s simpler than having several EC columns.

2 Likes

This was a helpful read:

6 Likes

Tried to get this working with the Google Places API Autocomplete but it errors, even though using the same URL in a browser returns a result, any ideas?

Google Places URL works in the browser:

Thanks a lot. :innocent:
Successfully fetched 3000 Street Addresses from Coordinates.

2 Likes

I’m able to fetch youtube data api v3 from URL and parse.

URL: https://www.googleapis.com/youtube/v3/videos?id={VIDEO_ID}&key={API_KEY}&part=snippet,contentDetails,statistics,status

For more Videos  |  YouTube Data API  |  Google Developers

3 Likes

More fun with Fetch!

LinkPreview API to grab featured title, description and image from any URL and display it in app:

6 Likes

I also getting the same error…any help on this?

It’s likely a CORS problem. I faced this many times and haven’t found out a way to get pass it.

1 Like

I have just read on CORS and it is beyond me. Maybe @david can help?

I also find it strange when I forked David’s GitHub, published the page and use it, I get this error below.errorforked

@ThinhDinh any insight of how to make this fetch column work? based as it is I have seen it worked twice…meaning I saw the values properly populated.
@Robert_Petitto was there any settings you did different to avoid the errors we had? I followed the video closely, but to no avail.

Thanks

It’s Github, so I assume you followed @Darren_Murphy’s guide to publish those Gits?

yes I did publish.

but even using David’s link, I have only seen system able to pull in the right data twice.

I started a new Glide Table (GT) to test and it is working fine. I think I tested using the Users GT and due to the fact that I had a lot of users, the amount of data it was trying to pull in may have upset the system. :cowboy_hat_face: :cowboy_hat_face:

Not all APIs can be fetched in the way this column works. They need to allow cross-origin requests.

1 Like

Right. For example, Payhere doesn’t work unfortunately

1 Like