Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more adaptor overview pages #590

Merged
merged 4 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adaptors/commcare.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CommCare is an open source Digital Public Good built by
[Dimagi](https://www.dimagi.com), which also offers paid options for use of its
CommCare cloud-hosted platform SaaS.

:::warning CommCare API Access
:::info CommCare API Access

If using CommCare SaaS, as of October '24, only
projects with the Pro Plan or above include API access
Expand Down Expand Up @@ -137,7 +137,7 @@ requiring you to set up a separate CommCare connection for each workflow.

## How to Extract or Modify CommCare Data

**See the available [helper functions](adaptors/packages/commcare-docs)** for a
**See the available [helper functions](/adaptors/packages/commcare-docs)** for a
full list of functions supported by this adaptor for extracting and/or modifying
CommCare data.

Expand Down
33 changes: 33 additions & 0 deletions adaptors/common.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Common Adaptor
---

## About OpenFn "Common" Language

Use this adaptor to write JavaScript, or to leverage common expressions and
[helper functions](/adaptors/packages/common-docs) for OpenFn.

This adaptor is typically used for transforming data in OpenFn workflows that
automate "ETL" (extract, transform, load) processes. See below examples.

```js
//use fn() to write your own functions
fn(state => {
// write javascript...
// ...to do some things to state
console.log(state.data); //or to debug
return state;
});
```

```js
//use each() to create 1 account for each form
each(
$.forms,
create('Account', {
Kobo_ID__c: $.data.id,
Name: $.data.customer_name,
Phone: $.data.customer_phone,
})
);
```