Forum Discussion

MICHAELSARGENT's avatar
MICHAELSARGENT
Qrew Cadet
2 years ago

Initialize Python Script using Quickbase Pipeline

We recently created an API where it gets Quickbase records, performs an IRR calculation using a python script, and writes the IRR calculation back to the Quickbase records.  The problem with this is that we have to run this against all Quickbase records in our table.  Ideally, we'd want a pipeline to trigger the API on that record alone, as to avoid incurring cost through a Databricks contract for having run the API daily against all records.  The issue we're running into is that the [Python] notebook runs behind our firewall so Quickbase can't run the pipeline successfully.  Anyone gotten this to work on internal VPNs?  Or, is there a different option to calculate IRR on a singular Quickbase record through a pipeline?



------------------------------
MICHAEL SARGENT
------------------------------
  • Do you have any alternatives to hosting it on your internal network such as AWS Lambda or Azure? That would solve your endpoint problem with the network. If you have such tools without the ability the host your code there but like Azure can access your network, you could potentially marry the two with a public endpoint in Azure that Pipelines can invoke that then hits a different endpoint on your internal server to run your script. 

    In lieu of those though you've got some other options if you're keeping it scripted: 

    1. Set your script up on a CRON job to query only for records that actually need an IRR calc - so records that have changed or haven't been processed yet, and then only run those. That way your script is only hitting Quickbase and doing minimal processing. You could set it up to run hourly to call Quickbase and if there are no records to run then kill the process and run again in an hour for any records that need processing. 
    2. Convert it to a codepage that runs a javascript function to do your calculation and then log it back to the record. The process here would be user initiated though - so click a button to run IRR
    3. Its possible depending on your data structure to do the IRR calc in Pipelines using loops or some version of a complex jinja setup. You'd be doing a loop of the cash flows, I don't have a clear line of sight or enough familiarity with IRR to speak to the ultimate method though
    4. You could try and find a public/free API that Pipelines can hit and then log the response. Best google result I found was this: https://rapidapi.com/kirs26/api/financecalc but I will not claim to be well versed in IRR to say if it's any good. Other options might exist though that Pipelines can interact with. 


    ------------------------------
    Chayce Duncan
    ------------------------------