Skip to main content
Solved

Doens't show the values in python


danilo_fme
Evangelist
Forum|alt.badge.img+41

Hi users,

I have a script that create a route between two points ( start and end ) using library googlemaps.

The return is going well to attribute in format JSON.

The idea is extract the route information in 'html_instructions'. In PyCharm is work when i execute it:

I configured my Workspace and execute ( attached template file), but it brings only the last route between two points.

How can i get inside my Workspace all route and turn a attribute? Attached the JSON generated by request googlemaps and Workspace.

Thanks in Advance,

Best answer by geosander

Live from my gate at Vancouver airport..! 🙂

 

The more "FME way" to do it, is to not use a PythonCaller at all, but an HTTPCaller, I guess. That will return a JSON response, from which you can extract the instructions using a JSONExtractor, for instance.

 

However, if you do want to use the PythonCaller, please have a look at the attached workspace. The trick is to write to a list attribute. You can concatenate the instruction strings afterwards using a ListConcatenator if you want.

View original
Did this help you find an answer to your question?

2 replies

geosander
Forum|alt.badge.img+7
  • Best Answer
  • May 26, 2017

Live from my gate at Vancouver airport..! 🙂

 

The more "FME way" to do it, is to not use a PythonCaller at all, but an HTTPCaller, I guess. That will return a JSON response, from which you can extract the instructions using a JSONExtractor, for instance.

 

However, if you do want to use the PythonCaller, please have a look at the attached workspace. The trick is to write to a list attribute. You can concatenate the instruction strings afterwards using a ListConcatenator if you want.


danilo_fme
Evangelist
Forum|alt.badge.img+41
  • Author
  • Evangelist
  • May 27, 2017
geosander wrote:

Live from my gate at Vancouver airport..! 🙂

 

The more "FME way" to do it, is to not use a PythonCaller at all, but an HTTPCaller, I guess. That will return a JSON response, from which you can extract the instructions using a JSONExtractor, for instance.

 

However, if you do want to use the PythonCaller, please have a look at the attached workspace. The trick is to write to a list attribute. You can concatenate the instruction strings afterwards using a ListConcatenator if you want.

Hello @sander_s , thanks your time when you wait your flight :)

 

Yes, i want to solve this with the transformer PythonCaller and your Workspace was perfect to resolve this. Thanks

 

 

I wish that you will have a excellent return your home.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings