Forum Discussion
Anonymous
5 years agoNot applicable
Get data from s3 bucket
Hello everybody, I want ot know please how can I get data from a bucket S3 AWS? Thank you. Best,
PhilipTreacy
5 years agoSuper User
Hi Anonymous
Do you want to retrieve a specific file? Or get a list of files? Or load data from several files?
If the bucket is set to Public access you can get a list of files using HTTP (Web Connector). S3 returns an XML file listing all files in that bucket. Copy/paste this code into a new blank query and replace BUCKETNAME with your bucket name.
let
Source = Xml.Tables(Web.Contents("https://BUCKETNAME.s3.amazonaws.com/")),
#"Expanded Contents" = Table.ExpandTableColumn(Source, "Contents", {"Key", "LastModified", "ETag", "Size", "StorageClass"}, {"Contents.Key", "Contents.LastModified", "Contents.ETag", "Contents.Size", "Contents.StorageClass"})
in
#"Expanded Contents"
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.