Forum Discussion
Airtable - Certain Columns Pulled in as Lists, Cannot Get the Data
- 7 years ago
Now I got it: As they are dropdown fields and just allow you to select existing/defined items, the returned values will be their keys. So you have to merge them with the respective tables to lookup their values from those tables.
That looks like a binary string, that PQ can handle. But it doesn't work as it is now.
Could you please check that there are no characters missing?
Thank you ImkeF. The query actually works and pulls most of the data I need. The only data challenge are with the columns within Airtable populated based on drop down lists.
I'm no query expert so knowledge is limited. I reviewed the query and since it works for most of the data, I see no reason why it won't grab the drop down option columns. From my limited knowledge, columns I need are listed as last part of query, bearer key is correct (though I changed for posting). Perhaps it needs another "expanded to stepA.4", middle part of query? Though I really have no idea.
Please see query below if it helps. I greatly appreciate your continued support:
let
Pagination = List.Skip( List.Generate( () => [Page_Key = "init", Counter=0], // Start Value
each [Page_Key] <> null, // Condition under which the next execution will happen
each [Page_Key = try if [Counter]<1
then ""
else [WebCall][Value][offset]
otherwise null, // determine the LastKey for the next execution
WebCall = try if [Counter]<1
then Json.Document(Web.Contents("https://api.airtable.com/v0/appeLOlVFTEAhg1NR/Opportunities", [Headers=[Authorization="Bearer keydXXXXXXXXXXXXX"]]))
else Json.Document(Web.Contents("https://api.airtable.com/v0/appeLOlVFTEAhg1NR/Opportunities?offset="&[WebCall][Value][offset] , [Headers=[Authorization="Bearer keyXXXXXXXXXXXXX"]])),// retrieve results per call
Counter = [Counter]+1// internal counter
],
each [WebCall]
),
1
),
#"Json2Table" = Table.RenameColumns(Table.FromList(Pagination, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore),{{"Column1", "stepA.1"}}),
#"Expanded to stepA.2" = Table.ExpandRecordColumn(#"Json2Table", "stepA.1", {"Value"}, {"stepA.2"}),
#"Expanded to stepA.3" = Table.ExpandRecordColumn(#"Expanded to stepA.2", "stepA.2", {"records"}, {"stepA.3"}),
#"Rows from stepA.3" = Table.RenameColumns(Table.ExpandListColumn(#"Expanded to stepA.3", "stepA.3"),{{"stepA.3", "stepB.1"}}),
#"Source" = Table.ExpandRecordColumn(#"Rows from stepA.3", "stepB.1", {"fields"}, {"Src"}),
#"Expanded Src" = Table.ExpandRecordColumn(Source, "Src", {"Autonumber", "Opportunity Title", "Project Duration ", "Total Opportunity Value (USD)", "Currency", "Country", "Proposal Lead", "Donor", "Prime", "Comments", "Win Probability", "Go/No-Go", "Year", "Status", "Submission Deadline (New)", "Start Date", "End Date", "PD/TAD LOE", "Surge Support", "Proposal Type", "Region", "Reference Number", "US/UK", "Country Code", "ICR", "# Mths", "Country Risk Rating", "Cost Lead", "Proposal Team"}, {"Src.Autonumber", "Src.Opportunity Title", "Src.Project Duration ", "Src.Total Opportunity Value (USD)", "Src.Currency", "Src.Country", "Src.Proposal Lead", "Src.Donor", "Src.Prime", "Src.Comments", "Src.Win Probability", "Src.Go/No-Go", "Src.Year", "Src.Status", "Src.Submission Deadline (New)", "Src.Start Date", "Src.End Date", "Src.PD/TAD LOE", "Src.Surge Support", "Src.Proposal Type", "Src.Region", "Src.Reference Number", "Src.US/UK", "Src.Country Code", "Src.ICR", "Src.# Mths", "Src.Country Risk Rating", "Src.Cost Lead", "Src.Proposal Team"})
in
#"Expanded SrcThanks,
ROKRI
- ImkeF7 years agoCommunity Champion
Code looks OK, as far as I can tell without actually seeing the data that is returned.
I believe that the returned data for your dropdown-fields is encoded and one has to find the correct encoding keys.
Otherwise error-would be shown.
- ImkeF7 years agoCommunity Champion
Now I got it: As they are dropdown fields and just allow you to select existing/defined items, the returned values will be their keys. So you have to merge them with the respective tables to lookup their values from those tables.
- ROKRI7 years agoHelper I
This is fantastic ImkeF , thank you!
Took me a bit to figure out how to merge the tables. Here's how I got it to work based on what I understood, curious if this is what you meant - I pulled into Power BI from Airtable the additional tables from which the initial one pulls drop down options. Then, using the "Manage Relationships" in Power BI, I was able to setup a one to many relationship between the Airtable data and it worked!
I appreciate your support and patience. Thank you for helping me solve this issue.
ROKRI