Participant Info
Participant information includes basic demographics as well as project-specific custom fields. See the data overview for information about participant identifiers and custom fields.
Get Participant Info
Use PartcipantSession.getParticipantInfo
to retrieve demographic information about the current participant, as well as project-specific custom fields.
SDK Reference
Examples
let info = try await session.getParticipantInfo()
// All demographics fields are optional.
let name = info.demographics.firstName ?? "Participant"
print("Hello, \(name)!")
if let medication1 = info.customFields["Medication1"] {
print("Participant is prescribed \(medication1).")
}
In the MyDataHelpsKit example app, see:
- Account/ParticipantInfoView.swift: ParticipantInfoView, visible on the Account tab, displays some basic info about the participant; customize this to use fields applicable to your app.