Skip to content

Instantly share code, notes, and snippets.

@dcjohnson24
dcjohnson24 / createResults.js
Created May 5, 2024 07:56
Get Patients from Postgres table patient and transform fields according to https://docs.google.com/spreadsheets/d/19ZJaudhQXy3J0lKcm5XdK3_ULNjDVMXaG7tuwlyc1zo/edit#gid=1730011001. Upload results to Salesforce object Indicator_Result__c
each('$.records[*]',
create('Indicator_Result__c', $.data)
)
// [R/T] ✘ AdaptorError: The requested resource does not exist
bulk(
'Indicator_Result__c',
'upsert',
{extIdField: 'Result_UID__c', failOnError: true, allowNoOp: true},
state => state.records
@dcjohnson24
dcjohnson24 / getPatient.js
Last active April 29, 2024 11:59
Get Patients from https://jsonplaceholder.typicode.com and upsert records to Salesforce
get('users');
// Follow the mapping spec here
// https://docs.google.com/spreadsheets/d/19ZJaudhQXy3J0lKcm5XdK3_ULNjDVMXaG7tuwlyc1zo/edit#gid=1822444315
fn(state => {
const addressArray = state.data.map(x => [
x.address.street,
x.address.suite,
x.address.city,
@dcjohnson24
dcjohnson24 / README.md
Last active May 9, 2022 20:20
Delete multiple file systems on AWS EFS

Required packages

  • jq
  • pv
  • docker or AWS CLI

If you have the AWS CLI already installed, change aws_fetch to

aws_fetch () {
 aws efs describe-file-systems --query 'FileSystems[*].FileSystemId' --no-paginate \