BrightLeaf Digital Code Snippet Library

Check out our growing library of code snippets for Gravity Forms!





Like our snippets? You'll 💜 GravityOps!

Goal This snippet adds a checkbox to your workflow steps. When checked the snippet will send the entry, when it is updated, to the workflow step. If the step has conditional logic it will check the logic and do nothing if it doesn't pass. Only one step per workflow can have this setting checked at a time. If the entry

Goal New: The snippet now also supports custom labels for the revert button on an Approval step, as well as Custom Submit Form label, Custom Update label, and Custom Save Progress label for the User Input step. This code snippet enhances Gravity Flow by allowing administrators to customize the text of the "Approve" and "Reject" buttons in an Approval step.

Goal Adds a setting to every Gravity Flow workflow step that pauses the entry on that step. Once paused, the entry does not move on unless it is manually moved to a different step. Useful when an earlier step hit an error and was routed to a "failure" route: the entry can sit on the designated step until the problem

Goal Allows editing of pricing fields in the Gravity Flow inbox entry view, replacing the usual "Pricing fields are not editable" message with the real field input. Configuration $workflow_form_ids: Update to include the form IDs where pricing fields should be editable. Optionally restrict to certain pricing field types via $allowed_pricing_types. Notes Applies only on the Gravity Flow inbox entry view

Goal This code snippet adds an "Export Forms as Text" feature to Gravity Forms, allowing administrators to export form structures, confirmations, notifications, and workflow steps as a downloadable text file. This is useful for documentation, backups, or sharing form configurations without requiring JSON exports. Features Adds an Export Forms as Text tab in the Gravity Forms export menu. Allows selection

Goal When Gravity Flow Form Connector creates a new entry, ensure multi‑file upload values are arrays (not JSON strings). Decodes JSON when detected and normalizes the array. This allows the entry to be created without errors.

Goal Adds a custom Gravity Flow step type that generates Gravity Forms Coupons dynamically during a workflow. Provides full UI to configure code, name, amount, type, target form, dates, limits, and stackability. Registers a {coupon_code} merge tag which outputs the code created for the entry.

Goal GravityFlow Approval and User Input steps have a little known quirk. Before processing the step (approval, rejection, user input, etc.) they clear the values from fields that are hidden by conditional logic if those fields are marked as editable OR are calculation fields. This snippet adds a multi select field to the bottom of your Approval or User Input

Goal This code snippet renames the "Workflow Complete" step in Gravity Flow by dynamically replacing it with the actual name of the last completed step in the workflow. This ensures that users see a meaningful step name rather than the generic "Workflow Complete" label when viewing GravityView entries. Configuration $form_ids: Update to the list of form IDs this should apply

Goal This code snippet enhances Gravity Flow by allowing workflows to be delayed or restarted based on GravityView approval and subscription payments. It provides options to: Delay workflow initiation until an entry is approved in GravityView instead of starting upon form submission. Restart the workflow upon each subscription payment for recurring payment scenarios. Update a date field when the workflow

Goal Gravity Flow's Approval step can show a third "Revert" button beside Approve and Reject, but the step it reverts to can only be a User Input step, and the setting is hidden altogether in a workflow that has no User Input step. Nothing in the engine requires that: the approval step's process_revert_status() ends the current step and starts whichever

Goal Monitors Gravity Flow workflows and alerts administrators when workflow fails to start after form submission. Critical for catching workflow configuration errors, conditional logic issues, or system failures that prevent automated processes from running. Checks both parent and nested child forms. Configuration $to: Add recipient email address in $to variable. Else, defaults to admin email. Features Workflow configuration details Conditional

Goal This snippet enhances the Update Entry and Create Entry workflow steps in Gravity Flow by allowing a field value to be automatically saved as an entry note. The note is recorded when a new entry is created or an existing entry is updated via workflow automation. Features Save Field Value as Entry Note – Select a field whose value

Goal Keeps a designated field (label default: "Workflow Step Field") up to date with the workflow status: On step start: current step name On workflow complete: complete step name On workflow cancel: "Cancelled" Configuration $status_field_label: If you use a different field label, change to your field label.