# Save Data Table Value (Text)

Grammar — Save value as name in the scope|Global/Local data table
FlagsNative | Action

Saves a text value into a data table. Data tables allow you to store and recall values using a string identifier. If you save a data table value using a string identifier that already exists, you will overwrite the old value, even if it is a different data type than the value you are saving.

# Arguments

  • bool<preset::DataScope> — Scope
  • string — Name
  • text — Value

Returns — void

native void DataTableSetText(
	bool global,
	string name,
	text val,
);

Category: Data Table / Save Value

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:2560

    // Automatic Variable Declarations
    // Implementation
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Name_C), lp_name);
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Suffix_C), lp_suffix);
    DataTableSetFixed(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Base_C), lp_base);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:2561

    // Implementation
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Name_C), lp_name);
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Suffix_C), lp_suffix);
    DataTableSetFixed(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Base_C), lp_base);
    DataTableSetBool(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_PresentAsRatio_C), lp_presentasRatio);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:2573

    // Automatic Variable Declarations
    // Implementation
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Name_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Award Name", 1));
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Suffix_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Description", 1));
    DataTableSetFixed(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Base_C), UserDataGetFixed("EndOfMatchMapSpecificAward", lp_userData, "Base", 1));

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:2574

    // Implementation
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Name_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Award Name", 1));
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Suffix_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Description", 1));
    DataTableSetFixed(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Base_C), UserDataGetFixed("EndOfMatchMapSpecificAward", lp_userData, "Base", 1));
    DataTableSetBool(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_PresentAsRatio_C), libNtve_gf_ConvertStringToBoolean(UserDataGetString("EndOfMatchMapSpecificAward", lp_userData, "Present as Ratio", 1)));

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:2580

    DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_BadgeIndex_C), UserDataGetString("EndOfMatchMapSpecificAward", lp_userData, "Award Badge Index", 1));
    DataTableSetString(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_ScoreValue_C), (UserDataGetGameLink("EndOfMatchMapSpecificAward", lp_userData, "Score Value Boolean", 1)));
    DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Tooltip_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Tooltip Text", 1));
    TriggerSendEvent(libGame_gv_eventID_MapSpecificAwardInitialize_C);
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:9344

    // Automatic Variable Declarations
    // Implementation
    DataTableSetText(true, (libCOOC_gf_CS_ObjectiveTableString(lp_objective) + "_" + "CustomToken"), lp_customText);
    libCOMI_gf_CM_UpdateObjectiveTextCampaign(lp_objective);
}