Fix job writing guide: update examples to current adaptor APIs#806
Open
hunterachieng wants to merge 2 commits into
Open
Fix job writing guide: update examples to current adaptor APIs#806hunterachieng wants to merge 2 commits into
hunterachieng wants to merge 2 commits into
Conversation
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
mtuchi
requested changes
Jun 17, 2026
mtuchi
left a comment
Contributor
There was a problem hiding this comment.
@hunterachieng can you also review all job examples or create a sub issue for it, I think we should try to clean up at least the top 5 adaptors
Contributor
Author
|
@mtuchi I checked the adaptor examples and majority are up to date |
Contributor
|
@hunterachieng i meant job examples for each of our adaptor, we mantain couple of examples in our docs
See this folder to see all our official job code library we mantain Most of these examples contain anti-patterns like writing nested operations, some are just using very old way of mapping |
mtuchi
reviewed
Jun 17, 2026
| }) | ||
| fn(state => { | ||
| const clean = val => | ||
| val == null ? '' : val.toString().replace(/-/g, ' '); |
Contributor
There was a problem hiding this comment.
Can you move clean outside the fn block,
I update
const clean = val =>
val === null ? '' : val.toString().replace(/-/g, ' ');1ddee10 to
0a6be0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Description
Updated all code examples in the job writing guide to reflect the current adaptor API. Removed legacy v1 helpers (
fields,dataValue,relationship,bulk, etc.) in favour of plain JavaScript objects and arrow functions, fixed deprecated 3-argument operation callbacks to use.then(), and corrected several syntax errors and typos across the guide.Closes #788
Details
The approach was to go through each file in the job writing guide and compare every code example against the current adaptor docs (salesforce-docs.md, dhis2-docs.md, http-docs.md, openmrs-docs.md, etc.) to verify the APIs being demonstrated still exist and match the current signatures.
The main pattern shift is that v1 adaptors used a set of functional helpers (
fields(),dataValue(),relationship()) to build operation arguments, whereas current adaptors accept plain JavaScript objects and arrow functions directly. Most examples needed to be rewritten around this, rather than just tweaked.AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to
know!):
You can read more details in our
Responsible AI Policy