# 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.stormmod

GameLib.galaxy

// L2560
DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Name_C), lp_name)
// L2561
DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Suffix_C), lp_suffix)
// L2573
DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Name_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Award Name", 1))
// L2574
DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Suffix_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Description", 1))
// L2580
DataTableSetText(false, TriggerEventParamName(libGame_gv_eventID_MapSpecificAwardInitialize_C, libGame_gv_eventParam_MapSpecificAwardInitialize_Tooltip_C), UserDataGetText("EndOfMatchMapSpecificAward", lp_userData, "Tooltip Text", 1))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L9315
DataTableSetText(true, (libCOOC_gf_CS_ObjectiveTableString(lp_objective) + "_" + "CustomToken"), lp_customText)