Decode a google polyline to GEOJSON coordinates

I have tried to translate the functionality in the link below to Bubble:
https://jsfiddle.net/welesley/tw7qLvh4/2
This converts a Google encoded polyline to GEOJSON coordinates

I have been trying to do this using toolbox run javascript feature.

can anyone help?