Skip to content

Conversation

@mtuchi
Copy link
Contributor

@mtuchi mtuchi commented Jul 15, 2025

Short Description

The KoboToolbox job code example in overview page was outdated. This PR updates the job code to latest and greatest pattern

Closes #672

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to
know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our
Responsible AI Policy

@mtuchi mtuchi linked an issue Jul 15, 2025 that may be closed by this pull request
@mtuchi mtuchi requested a review from josephjclark July 15, 2025 06:59
getSubmissions($.data.formId, {
query: { end: { $gte: `${$.cursor}` } },
}).then(state => {
const { name, formId } = state.references.at(-1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a comment here explaining this line. Like Lookup each form's id from the previous state

I also wish we had an easier answer to this. After the each it's always super hard to chain functionality based on the item under iteration. I guess this works but I wish we ad something more elegant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I totally agree, every time i write that code my eyes squint a little and i get ptsd from my previous job writing training having to explain why references.at(-1) 😮‍💨

@mtuchi
Copy link
Contributor Author

mtuchi commented Jul 16, 2025

@josephjclark thanks for the feedback I have updated the readme, please have another look

// set the cursor to use for this run
cursor($.lastEnd || $.manualCursor || '2020-11-20T14:32:43.325+01:00');

// set the cursor for the next run"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josephjclark i have removed ". Done ✅

@mtuchi mtuchi requested a review from josephjclark July 23, 2025 07:50
@josephjclark josephjclark merged commit f846dd0 into main Jul 23, 2025
1 check passed
@josephjclark josephjclark deleted the 672-kobo-docs branch July 23, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

kobotoolbox docs are bang out of date

3 participants