Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Friends,
I am writing first python script in Power BI but but I get some nasty error which goes over my head.
Here is my script
import requests
import pandas as pd
# Set the request parameters
url = 'https://myinstance.xyz-wow.com/api/now/table/incident'
user = 'abc'
password = 'xyz'
headers = {"Content-Type": "application/json", "Accept": "application/json"}
# Do the HTTP request within a try-except block to handle potential errors
try:
response = requests.get(url, auth=(user, password), headers=headers)
response.raise_for_status() # This will raise an exception for HTTP errors
data = response.json()
# Since Power BI expects a DataFrame, we'll convert the resulting data to a DataFrame
# It is assumed data['result'] contains the records you want to display
df = pd.DataFrame(data['result'])
# Output the DataFrame into Power BI
# Please note that the last dataframe in the script will be the one imported into Power BI
df
except requests.exceptions.RequestException as e:
print(f'An error occurred: {e}')
This is what I am getting for it
Solved! Go to Solution.
Hi @smerugu28
There could be various reasons for the error message you attached.
Please refer to the linked discussions about similar challenges :
https://stackoverflow.com/questions/58522535/ado-net-error-trying-to-run-python-script-in-powerbi
And the linked videos:
https://www.youtube.com/watch?v=5D0BkNsu5CM
https://www.youtube.com/watch?v=fd7OYfeSGXE
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Thank you for your prompt reply! @Ritaf1983
Hi @smerugu28
Ensure that the API endpoint is accessible with the credentials you're using. You can do this by attempting to access the URL directly in a web browser or using a tool like Postman.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your prompt reply! @Ritaf1983
Hi @smerugu28
Ensure that the API endpoint is accessible with the credentials you're using. You can do this by attempting to access the URL directly in a web browser or using a tool like Postman.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @smerugu28
There could be various reasons for the error message you attached.
Please refer to the linked discussions about similar challenges :
https://stackoverflow.com/questions/58522535/ado-net-error-trying-to-run-python-script-in-powerbi
And the linked videos:
https://www.youtube.com/watch?v=5D0BkNsu5CM
https://www.youtube.com/watch?v=fd7OYfeSGXE
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 63 | |
| 55 | |
| 42 | |
| 41 | |
| 23 |
| User | Count |
|---|---|
| 167 | |
| 136 | |
| 120 | |
| 79 | |
| 54 |