Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update execute query function #189

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GibsonSoft
Copy link

This small PR updates the ExecuteQuery call so that all fields are returned in the result table, versus just the ones in the first row.

It's possible for the first object of the returned JSON to not include all possible columns. This can result in the following errors in Power Query:
image
{E1241472-DE8C-4250-B043-11CF0758780D}

In my case, when calling INFO.EXPRESSIONS(), the first two rows did not contain the QueryGroupID field, which caused the table to be created without it. The other rows then started to include it, causing them to error out.

This PR implements a solution similar to the one posted here, by first combining all of the records and pulling the distinct list of field names from the result. The records are then padded with any missing fields before returning the final result.

image

I'm guessing this is mostly applicable when running queries against INFO functions.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant