Coder Social home page Coder Social logo

tpizzle61 / bamboohr-gsheetwriter Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 7 KB

A Google Apps Script function to pull custom reports from BambooHR into Google Sheets.

JavaScript 100.00%
apps-script gsheets google-apps-script google-sheets bamboohr bamboohr-api

bamboohr-gsheetwriter's Introduction

BambooHR-gsheetwriter

A Google Apps Script function to pull custom reports from BambooHR into Google Sheets.

Enter the domain name and report number of your custom report

Open your custom report in BambooHR and view the link as below.

https://mycompany.bamboohr.com/reports/custom/My+Custom+Report/983

Your domain name will be the first part of the link before '.bamboohr' (in this example, 'mycompany'), while the report number will be the number at the end of the link (in this example, 983). Build out the report link in the first part of the script using your company domain name and report number as follows:

var url = "https://api.bamboohr.com/api/gateway.php/mycompany/v1/reports/983?format=xml";

Enter your API key

You will need to obtain an API key from a system administrator in BambooHR. Your API key is viewable in BambooHR by clicking your profile photo in the top right corner of your screen and then selecting "API Keys" in the dropdown. Contact your system administrator if you do not see this option.

Once you have obtained your API key, enter the key in the appropriate section of the script:

var apiKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

Enter the destination GSheet link

This is the sheet where you want your report to live. If you don't have a specific location in mind, create a new GSheet and copy the link and paste it here.

var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

Test your function

To test the program, hit run in your script editor. Once the script has run fully, check your destination GSheet to see if your desired output has been written to the sheet.

Automate your function

To automate your function, in the script editor go to Edit -> Current project's triggers. This will take you to your projects's triggers screen.

Once at the triggers screen, add a trigger. If you would like the report to refresh daily, choose 'Time-driven' as the event source and select a time of day that you would like the report to refresh.

bamboohr-gsheetwriter's People

Contributors

mckayc avatar tpizzle61 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mckayc

bamboohr-gsheetwriter's Issues

Execution completed but the results are not in the sheet

Hey,

I have tested your code by copy pasting in the google app script and following your instructions.

I runned it, it asks for authorization which I granted and then the execution is completed but no data is showing up in the worksheet.

I thought it was supposed to say successfully saved data but I don't have this message.

Can you help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.