Advanced
Dynamically Completing a Step
There are few ways to complete a Step on behalf of a user either programmatically or automatically via the completionCriteria
property.
Programmatically Marking a Step Completed
Call the markStepCompleted
method from the useFlow hook in the SDK:
import { useFlow } from '@frigade/react';
const { flow } = useFlow("my-flow-id");
await flow.steps.get('my-step-id').complete();
Completion Criteria
Use the completionCriteria
property on a step to automatically mark the step as completed when a user meets the criteria. See Targeting for more information.
steps:
- id: my-step-id
...
completionCriteria: user.property('connectedBank') == true
API Methods
You can also mark steps completed in your backend via the flowResponses endpoint or our Javascript SDK.