> For the complete documentation index, see [llms.txt](https://codifi-fdm.gitbook.io/codifi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codifi-fdm.gitbook.io/codifi-docs/cross-platform-features/ripple/media-and-completion.md).

# Media & Completion

Ripple can react to the photos, documents, videos, and audio files attached to Records, and it can track which required fields have been filled in. This is useful for enforcing documentation requirements and building progress indicators.

***

## Media & Attachment Awareness

| Property                       | Description                                         | Example use                                  |
| ------------------------------ | --------------------------------------------------- | -------------------------------------------- |
| `hasMedia`                     | Does the Record have any attachments?               | Show *Add Photos* reminder if no media       |
| `mediaCount`                   | Number of attachments (all types)                   | "5 attachments"                              |
| `photoCount`                   | Number of photos attached                           | "4 photos attached"                          |
| `videoCount`                   | Number of videos attached                           | Require at least 1 video for some conditions |
| `documentCount`                | Number of documents attached                        | Verify permit documents uploaded             |
| `audioCount`                   | Number of audio files attached                      | Voice-note tracking                          |
| `totalFileSize`                | Combined size of all attachments                    | Monitor storage usage                        |
| `countMediasByExtension`       | Count files of a specific extension                 | Count `.pdf` or `.dwg` files                 |
| `hasMediaWithExtension`        | Check if any file of a given extension is attached  | Has at least one PDF?                        |
| `gpsLatitude` / `gpsLongitude` | GPS coordinates from a photo's EXIF metadata        | Verify photo location matches Record         |
| `dateTaken`                    | Date from a photo's EXIF metadata                   | Confirm photo date matches fieldwork         |
| `mediaSubTypeName`             | Name of the media's subtype (e.g. "Overview Photo") | Filter or summarize by subtype               |

#### Example: Photo Documentation Requirement

Show a warning message until enough photos are taken.

**Visibility formula** (on the warning field): show when `photoCount < 3`.

**Value formula** (for the warning text):

```
concat("Please take at least 3 photos. Currently: ",
       photoCount, " photo(s) attached.")
```

When the user attaches their 3rd photo, the warning automatically disappears.

***

## Completion Tracking & Validation

Ripple tracks which required fields have been filled in and can compute completion percentages. This is useful for quality control and workflow management.

| Property              | Description                          | Example use                             |
| --------------------- | ------------------------------------ | --------------------------------------- |
| `completionPercent`   | 0–100% of required fields completed  | Show progress bar on dashboard          |
| `requiredFieldCount`  | Total number of required fields      | "20 fields required"                    |
| `completedFieldCount` | Required fields with values          | "17 of 20 complete"                     |
| `isRequired`          | Whether a specific field is required | Highlight unfilled required fields      |
| `isPending`           | Required AND still empty             | Show red indicator on incomplete fields |

{% hint style="info" %}
`completionPercent` returns a number from **0 to 100** — not 0 to 1. So `completionPercent > 50` means more than half complete, and `completionPercent = 100` means every required field has a value.
{% endhint %}

#### Example: Record Completion Summary

Show users how close they are to finishing a Record.

```
Completion Status = concat(
  completedFieldCount, " of ", requiredFieldCount,
  " required fields complete (",
  round(completionPercent, 0), "%)"
)
```

**Result:** `"17 of 20 required fields complete (85%)"`

**Visibility formula** for a *Ready for Review* section: show when `completionPercent = 100`.

***

## See Also

* [Visibility Formulas](/codifi-docs/cross-platform-features/ripple/visibility-formulas.md) — gate sections on completion percent or media counts
* [Value Formulas](/codifi-docs/cross-platform-features/ripple/value-formulas.md) — concatenate completion data into status messages
* [Operations Reference](/codifi-docs/cross-platform-features/ripple/reference.md#media--completion) — every media and completion operator with return types
