Skip to main content

findRepeatingWrite

Finds the write of a journey that repeats over a list answer: the write whose forEach names the answer and that declares targetBy and targets. Writes without forEach never match.

import { findRepeatingWrite } from '@conduction/nextcloud-vue'

const write = findRepeatingWrite(journey.steps, 'producten')
// { targetBy: 'product', targets: { parkeervergunning: { typeValue: 'PV' } } } or null

Used with CnJourneyReviewList.

ParameterTypeDescription
stepsArrayThe journey's steps in order, each with an optional writes array.
answerKeystringThe list answer's key, matched against each write's forEach.