{"name":"tvSortByValue","operator":null,"title":"tvSortByValue","type":"command","url":"https://community.bistudio.com/wiki/tvSortByValue","revid":378381,"updated":"2026-04-04T04:47:06Z","groups":["GUI Control - Tree View"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.74"}],"since":{"game":"arma3","name":"Arma 3","version":"0.74"},"arma3_since":"0.74","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Sorts all children of given path. Value of Tree View entries is used for sorting. tvSetValue can be used to set the value for a given path.","syntaxes":[{"syntax":"control tvSortByValue [path, ascending]","since":null,"effect":null,"exec":null,"params":[{"name":"control","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"control: Control"},{"name":"path","type":"Tree View Path","optional":false,"default":null,"description":"the parent item to sort","types":["Tree View Path"],"since":null,"text":"path: Tree View Path - the parent item to sort"},{"name":"ascending","type":"Boolean","optional":true,"default":"false","description":"true to sort ascending, else descending","types":["Boolean"],"since":null,"text":"ascending: Boolean - (Optional, default false) true to sort ascending, else descending"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"control","types":["Control"]},"right":{"text":"[path, ascending]","types":["Array"]}},{"syntax":"tvSortByValue [idc, path, ascending]","since":null,"effect":null,"exec":null,"params":[{"name":"idc","type":"Number","optional":false,"default":null,"description":"control idc","types":["Number"],"since":null,"text":"idc: Number - control idc"},{"name":"path","type":"Tree View Path","optional":false,"default":null,"description":"the parent item to sort","types":["Tree View Path"],"since":null,"text":"path: Tree View Path - the parent item to sort"},{"name":"ascending","type":"Boolean","optional":true,"default":null,"description":"true to sort ascending, else descending. Default: false","types":["Boolean"],"since":null,"text":"ascending: Boolean - (Optional) true to sort ascending, else descending. Default: false"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"[idc, path, ascending]","types":["Array"]}}],"examples":[{"text":"```sqf\ncontrol tvSortByValue [[0], false];\n```","code":["control tvSortByValue [[0], false];"]},{"text":"```sqf\ntvSortByValue [102, [0], false];\n```","code":["tvSortByValue [102, [0], false];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["lbSortBy","lnbSortBy","tvSortAll","tvSort","tvSortByValueAll"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control - Tree View","Introduced with Arma 3 version 0.74","Scripting Commands"]}