LootLocker Unreal SDK 11.1.0
Game backend SDK for Unreal Engine
Loading...
Searching...
No Matches
FLootLockerSurveyAnswer Struct Reference

A single answer to a survey question, submitted through SubmitSurveyAnswers. More...

#include <LootLockerSurveysRequestHandler.h>

Static Public Member Functions

static FLootLockerSurveyAnswer FromText (const FString &MetadataKey, const FString &Value)
 Build a String answer, for short_text, long_text, date and select questions.
static FLootLockerSurveyAnswer FromNumber (const FString &MetadataKey, double Value)
 Build a Number answer, for number questions.
static FLootLockerSurveyAnswer FromBool (const FString &MetadataKey, bool Value)
 Build a Bool answer, for checkbox questions.
static FLootLockerSurveyAnswer FromMultiSelect (const FString &MetadataKey, const TArray< FString > &SelectedValues)
 Build a Json answer, for multiselect questions.

Data Fields

FString Metadata_key = ""
 The metadata_key of the question this answers.
FString Value = ""
 The answer value.
ELootLockerMetadataTypes Type = ELootLockerMetadataTypes::String
 The metadata type of the value.

Detailed Description

A single answer to a survey question, submitted through SubmitSurveyAnswers.

The metadata API validates the declared type against the value, so a checkbox answer must be declared Bool, a number Number, and a multiselect Json — sending everything as String is rejected. Build these with MakeSurveyTextAnswer and friends rather than filling the fields by hand: they format Value to match Type.

Member Function Documentation

◆ FromBool()

FLootLockerSurveyAnswer FLootLockerSurveyAnswer::FromBool ( const FString & MetadataKey,
bool Value )
static

Build a Bool answer, for checkbox questions.

◆ FromMultiSelect()

FLootLockerSurveyAnswer FLootLockerSurveyAnswer::FromMultiSelect ( const FString & MetadataKey,
const TArray< FString > & SelectedValues )
static

Build a Json answer, for multiselect questions.

◆ FromNumber()

FLootLockerSurveyAnswer FLootLockerSurveyAnswer::FromNumber ( const FString & MetadataKey,
double Value )
static

Build a Number answer, for number questions.

◆ FromText()

FLootLockerSurveyAnswer FLootLockerSurveyAnswer::FromText ( const FString & MetadataKey,
const FString & Value )
static

Build a String answer, for short_text, long_text, date and select questions.

Field Documentation

◆ Metadata_key

FString FLootLockerSurveyAnswer::Metadata_key = ""

The metadata_key of the question this answers.

◆ Type

The metadata type of the value.

Must match the question's field_type: short_text/long_text/date/select -> String, number -> Number, checkbox -> Bool, multiselect -> Json.

◆ Value

FString FLootLockerSurveyAnswer::Value = ""

The answer value.

For String answers this is the raw text, stored verbatim (no quoting needed). For Number, Bool and Json answers it is a JSON literal: 42, true, and ["a","b"].

Prefer MakeSurveyTextAnswer and friends, which format this for you.