Skip to content

Import and display workouts

HealthBridge normalizes HealthKit and Health Connect workouts into FHealthBridgeWorkout records.

In Blueprint, call Get Recent Workouts on HealthBridgeSubsystem after successful initialization. Choose the number of days and maximum records your screen actually needs.

In C++:

FHealthBridgeService::GetRecentWorkoutsDetailed(
7,
25,
[](const TArray<FHealthBridgeWorkout>& Workouts, bool bSuccess)
{
if (!bSuccess)
{
return;
}
for (const FHealthBridgeWorkout& Workout : Workouts)
{
// Add one view model or widget row per workout.
}
});

Use the detailed result when your UI must distinguish a failed import from a successful empty history. The simpler GetRecentWorkouts callback returns only the workout array.

Common fields include:

  • Id: provider record identifier.
  • ExerciseType: normalized activity label.
  • StartTime and EndTime: UTC Unix milliseconds.
  • Duration: milliseconds.
  • Optional calories, distance, and steps guarded by bHas... fields.
  • Location: indoor, outdoor, or unknown.
  • Source: contributing platform or app.
  • bIsAppCreated: whether the current app created the workout.

Workout summary distance is expressed in kilometers. Use Blueprint helper nodes to convert timestamps and duration instead of duplicating conversion logic.

Platforms and source devices do not populate every metric. Hide an unavailable metric when its bHas... flag is false. Do not render zero as though it were a measured value.

Unknown exercise types can normalize to Other. Keep that label usable rather than dropping the record.

Use Tools > HealthBridge > Mock Workouts to create:

  • A complete running workout.
  • A workout without calories or distance.
  • An indoor workout.
  • An unknown or Other exercise.
  • An empty curated list.

Verify that the UI remains useful in every case.