Skip to main content
Question

invalid literal for int() with base 10:

  • Mar 18, 2022 1:51 PM UTC
  • 0 replies
  • 542 views

Forum|alt.badge.img+1
I am currently building a pipeline that uses a Webhook to make an API call into openweathermap.org and return a daily JSON file with that day's weather conditions. 

I then sort through the JSON file using some REGEX code to splice out the data that I want, and am attempting to file that data and build new entries in a Weather Table in one of my apps. I've done this same process with a different API call and had no issues. However, I am currently running into a problem when I try inputting the sorted data into my tables fields in the third step. I keep getting the following error.

invalid literal for int() with base 10: 'WindSpeed'

I have tried a myriad of different things including changing the table field from numeric, to text, to numeric currency. I have also tried using Jinja to transform my incoming data using {{b.WindSpeed|int}}, {{b.WindSpeed|float}}, {{b.WindSpeed|string}}. 

Has anyone else had this issue? Or have any other ideas of how to address this?

------------------------------
TVENT Admin
------------------------------
This topic has been closed for replies.

The error message invalid literal for int() with base 10 would seem to indicate that you are passing a string that's not an integer to the int() function . In other words it's either empty, or has a character in it other than a digit.

------------------------------
Paul Peterson
------------------------------

  • Observing
  • Jan 31, 2023 9:33 PM UTC
Did you ever find out what the problem was? What was your resolution if you did find a solution?

------------------------------
Russell Hansen
------------------------------

Forum|alt.badge.img+6
  • Quickbase Staff
  • Feb 6, 2023 3:40 PM UTC
Sounds like you did a query step but didn't use a loop on the results. If you're not using a loop you need to specify the index explicitly:  {{ b[0].windspeed }}

Hope that helps!

------------------------------
Doug Henning
------------------------------