Best answer

How to pull Python code from a GitHub and reformat it for Google Sheets?

  • 14 February 2022
  • 2 replies
  • 102 views

Disclaimer: I am not a coder...I've tried researching how to do this on my own, but I'm too far out of my wheelhouse to figure it out. So, I'm hoping someone can show me how to use the Python actions inside of Zapier to automate a repetitive task.

The Goal:

I want to be able to pull the data of "new move-ins" to the area from my church's website (name, address, phone, etc) and have it put into a Google Sheet, so I can keep track of efforts to welcome them. I know how to set up everything in the Zap, except for the Python actions that pull the data from the site and then formats it the way I need it for the spreadsheet.

Someone has already coded a way to pull the info I want using Python, and posted it on GitHub here: https://githubhelp.com/SpencerMKSmith/LCR-API

It says: To Install, Run:

pip3 install lcr-api

Usage:

from lcr import API as LCR

lcr = LCR("<LDS USERNAME>", "<LDS PASSWORD>", <UNIT NUMBER>)

months = 5
move_ins = lcr.members_moved_in(months)

for member in move_ins:
print("{}: {}".format(member['spokenName'], member['textAddress']))

This is the church website, and this is the specific move-in report I want to pull from--both of which are password protected (my login info gives me access).

Moderator Edit: External website links removed

The current Zap configuration I am using is: "Schedule by Zapier" > "Get by Zapier" > "Code by Zapier (Run Python)" > "Google Sheets"

The problem is that, as I said, I am not a coder, so I am at a loss as to how I should be implementing the code from GitHub within Zapier to get the result I want.

I have tried putting different combinations of the GitHub code into the "Get by Zapier" and "Code by Zapier" actions, but I always just get: "Syntax Error in Code" & "No Data in Mapped Fields"

For reference, this is what the data looks like on the original site: Members Moved-In Report

I'd like to pull all of the info points from the site (name, age, move in date, household position, gender, address, phone) into their own columns in the Google Sheet--as it is all potentially useful when welcoming people to the area.

My question is how do I structure the "Get by Zapier" and "Code by Zapier" actions to get that result?

I welcome any questions and appreciate the help!

icon

Best answer by SamB 16 February 2022, 11:38

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +11

Hey @kialikhon4e4, welcome to the Community!

Unfortunately you wouldn’t be able to install that external library (pip module) from GitHub using a Code by Zapier step - Limitations with Code steps

If your church’s website has a public API then you’d be able to set up a GET request using a Webhooks by Zapier step to search for the desired information. You can find out more about working with webhooks in Zapier here:


Hope that helps to point you in the right direction! :slight_smile:

ok thanks! Appreciated looks. 
 

Moderator Edit: External website link removed