How to get values (item ids) from executeQueryAsync and store them as arrays CSOM

%3CLINGO-SUB%20id%3D%22lingo-sub-293933%22%20slang%3D%22en-US%22%3EHow%20to%20get%20values%20(item%20ids)%20from%20executeQueryAsync%20and%20store%20them%20as%20arrays%20CSOM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-293933%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3BHi%20All%2C%3CBR%20%2F%3E%26nbsp%3BI%20have%20been%20trying%20to%20do%20an%20update%20via%20CSOM%20but%20I%20have%20had%20issues%20with%20timeout%20so%20it%20was%20recommended%20I%20do%20it%20in%20batches.%3CBR%20%2F%3EI%20have%20got%20the%20batches%20running%20but%20i'm%20having%20issues%20on%20how%20to%20get%20the%20item%20ids%20in%26nbsp%3BexecuteQueryAsync%26nbsp%3B%20and%20using%20it%20to%20update%20items.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EPlease%20see%20my%20code%20below%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E%26nbsp%3B%20%3CSPAN%3E%2F%2FI%20want%20the%20below%20returned%20as%20an%20array%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20var%20IDs%20%3D%20%5B1%2C%202%2C%203%2C%204%2C%205%2C%206%2C%207%2C%208%2C%209%2C%2010%2C%2011%2C%2012%2C%2013%2C%2014%2C%2015%2C%2016%2C%2017%2C%2018%2C%2019%2C%2020%2C%2021%2C%2022%2C%2023%2C%2024%2C%2025%2C%2026%2C%2027%2C%2028%2C%2029%2C%2030%5D%3B%20%2F%2F%20List%20of%20our%20item%20IDs%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20%2F%2F%20how%20can%20i%20get%20the%20above%20usiing%20something%20like%20the%20below%3F%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20%2F%2Fvar%20IDs%20%3D%20listArray()%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EI%20have%20read%20about%20having%20to%20use%20callbacks%20to%20achieve%20this%20scenario%20but%20looking%20for%20help%20to%20achieve%20this.%3CBR%20%2F%3EAny%20help%20would%20be%20appreciated%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BFull%20code%20below%3C%2FP%3E%3CBLOCKQUOTE%3E%3CDIV%3E%3CBR%20%2F%3E%3CSCRIPT%20language%3D%22%26quot%3Bjavascript%26quot%3B%22%20type%3D%22%26quot%3Btext%2Fjavascript%26quot%3B%22%3E%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20items%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20oList%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20oListItem%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20IDs%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bfunction%20getItemsToBeUpdated()%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%23lblprogress%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B).text(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BUpdating%20items%20please%20wait....%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%23lblprogress%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B).show()%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20siteUrl%20%3D%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%2Fsites%2FTeam%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20clientContext%20%3D%20new%20SP.ClientContext(siteUrl)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%2F%2Fvar%20clientContext%20%3D%20new%20SP.ClientContext.get_current()%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20oList%20%3D%20clientContext.get_web().get_lists().getByTitle(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BTest%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20camlQuery%20%3D%20new%20SP.CamlQuery()%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3BcamlQuery.set_viewXml(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BView%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BQuery%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FQuery%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BRowLimit%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B100%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FRowLimit%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FView%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20items%20%3D%20oList.getItems(camlQuery)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3BclientContext.load(items)%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20clientContext.executeQueryAsync(onUpdateSucceeded%2C%20onUpdateFailed)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%2F%2FI%20want%20the%20below%20returned%20as%20an%20array%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20IDs%20%3D%20%5B1%2C%202%2C%203%2C%204%2C%205%2C%206%2C%207%2C%208%2C%209%2C%2010%2C%2011%2C%2012%2C%2013%2C%2014%2C%2015%2C%2016%2C%2017%2C%2018%2C%2019%2C%2020%2C%2021%2C%2022%2C%2023%2C%2024%2C%2025%2C%2026%2C%2027%2C%2028%2C%2029%2C%2030%5D%3B%20%2F%2F%20List%20of%20our%20item%20IDs%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%2F%2F%20how%20can%20i%20get%20the%20above%20usiing%20something%20like%20the%20below%3F%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%2F%2Fvar%20IDs%20%3D%20listArray()%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20itemsToLoadForUpdate%20%3D%20Array()%3B%20%2F%2F%20Holds%20our%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bcurrent%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%20items%20to%20update%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20totalItemsToUpdate%20%3D%2030%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20limitItemsToUpdate%20%3D%2010%3B%20%2F%2F%20Update%20every%2090%20items%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20batchUpdatesCounter%20%3D%20Math.ceil(totalItemsToUpdate%20%2F%20limitItemsToUpdate)%3B%20%2F%2F%20If%20you%20need%20to%20count%20the%20remaining%20batch%20updates%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20restItemsToUpdate%20%3D%200%3B%20%2F%2F%20Items%20to%20update%20after%20(see%20below)%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20for%20(var%20i%20%3D%200%3B%20i%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%20IDs.length%3B%20i%2B%2B)%20%7B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20var%20oListItem%20%3D%20oList.getItemById(IDs%5Bi%5D)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3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amp%3Bamp%3Bamp%3B%2339%3BUpdating%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%2B%20restItemsToUpdate%20%2B%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20items...%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20clientContext.executeQueryAsync(this.onUpdateSucceeded%2C%20this.onUpdateFailed)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%7D%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3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3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%23lblprogress%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B).text(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BItems%20Updated%20Successfully%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%2F%2Falert(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BItems%20Updated%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B)%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%23reset%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B).show()%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3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amp%3B%2339%3BRequest%20failed.%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%2B%20args.get_message()%20%2B%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%5Cn%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%2B%20args.get_stackTrace())%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%23lblprogress%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B).hide()%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%23lblerror%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B).text(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3BRequest%20failed.%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%2B%20args.get_message()%20%2B%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%5Cn%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%20%2B%20args.get_stackTrace())%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%24(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B%23reset%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3B%2339%3B).show()%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BDIV%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%20%7D%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FSCRIPT%3E%3C%2FDIV%3E%3C%2FBLOCKQUOTE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320606%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20values%20(item%20ids)%20from%20executeQueryAsync%20and%20store%20them%20as%20arrays%20CSOM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320606%22%20slang%3D%22en-US%22%3EThanks%20I%20sorted%20it%20out%20already.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-294513%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20values%20(item%20ids)%20from%20executeQueryAsync%20and%20store%20them%20as%20arrays%20CSOM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-294513%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89836%22%20target%3D%22_blank%22%3E%40Patrick%20Rote%3C%2FA%3E%2C%20it's%20been%20a%20while%20since%20I%20did%20this%20type%20of%20thing%20in%20JS%20but%20I'll%20try%20and%20give%20you%20some%20steer.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20execute%20your%20CAML%20query%2C%20you%20should%20get%20a%20ListItemCollection%20back.%20Iterate%20through%20that%20collection%20e.g.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDeclare%20Array%20Variable%3C%2FP%3E%3CP%3EFor%20Each%20Item%20in%20ItemCollection%3C%2FP%3E%3CP%3EPush%20Item.Id%20to%20your%20array%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20that%20doesn't%20work%2C%20please%20share%20any%20specific%20errors%20that%20you're%20getting%20and%20I'll%20aim%20to%20help%20you%20through%20it%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-294471%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20values%20(item%20ids)%20from%20executeQueryAsync%20and%20store%20them%20as%20arrays%20CSOM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-294471%22%20slang%3D%22en-US%22%3E%3CP%3ENo%20one%20responds%20here...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-293990%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20values%20(item%20ids)%20from%20executeQueryAsync%20and%20store%20them%20as%20arrays%20CSOM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-293990%22%20slang%3D%22en-US%22%3EAny%20help%20or%20suggestions%3F%3C%2FLINGO-BODY%3E
Highlighted
Contributor

 Hi All,
 I have been trying to do an update via CSOM but I have had issues with timeout so it was recommended I do it in batches.
I have got the batches running but i'm having issues on how to get the item ids in executeQueryAsync  and using it to update items.

Please see my code below

  //I want the below returned as an array
   var IDs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]; // List of our item IDs
   
   // how can i get the above usiing something like the below?
   //var IDs = listArray();

I have read about having to use callbacks to achieve this scenario but looking for help to achieve this.
Any help would be appreciated

 

 Full code below


<script language="javascript" type="text/javascript">
var items;
var oList;
var oListItem;
var IDs;
function getItemsToBeUpdated()
{
  $('#lblprogress').text("Updating items please wait.... ");
  $('#lblprogress').show();
  
    var siteUrl = '/sites/Team/';

    var clientContext = new SP.ClientContext(siteUrl);
    //var clientContext = new SP.ClientContext.get_current();
   
    oList = clientContext.get_web().get_lists().getByTitle('Test');
   
    var camlQuery = new SP.CamlQuery();
 camlQuery.set_viewXml('<View><Query></Query><RowLimit>100</RowLimit></View>');
    items = oList.getItems(camlQuery);
 clientContext.load(items);   
    clientContext.executeQueryAsync(onUpdateSucceeded, onUpdateFailed);
   
   //I want the below returned as an array
   var IDs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]; // List of our item IDs
   
   // how can i get the above usiing something like the below?
   //var IDs = listArray();
  
    var itemsToLoadForUpdate = Array(); // Holds our "current" items to update
    var totalItemsToUpdate = 30;
    var limitItemsToUpdate = 10; // Update every 90 items
   
    var batchUpdatesCounter = Math.ceil(totalItemsToUpdate / limitItemsToUpdate); // If you need to count the remaining batch updates
    var restItemsToUpdate = 0; // Items to update after (see below)
    for (var i = 0; i < IDs.length; i++) {
        var oListItem = oList.getItemById(IDs[i]);
      
         oListItem.set_item('Force_x0020_Update', 'Force Update');

        oListItem.update();
        itemsToLoadForUpdate[i] = oListItem;
        clientContext.load(itemsToLoadForUpdate[i]);
        if (i && i % limitItemsToUpdate == 0) {
            console.log('Updating ' + limitItemsToUpdate + ' items...');
            clientContext.executeQueryAsync(this.onUpdateSucceeded, this.onUpdateFailed);
            restItemsToUpdate = 0;
        }
        else { // Remaining items to update
            restItemsToUpdate = i % limitItemsToUpdate;
        }
    }
    if (restItemsToUpdate) {
         //console.log('Updating rest items...');
         console.log('Updating ' + restItemsToUpdate + ' items...');
        clientContext.executeQueryAsync(this.onUpdateSucceeded, this.onUpdateFailed);
    }
        
}
function listArray()
{
 var IDs = [];
   var itemEnumerator = items.getEnumerator();
    while(itemEnumerator.moveNext()){
   
   
       
        var item = itemEnumerator.get_current();
       
        // You now have the item you were looking for!
        // console.log(item.get_item("ID"));
        
         IDs = item.get_item("ID");
        
    }
   
   return IDs;

}
 
function onUpdateSucceeded() {
  
$('#lblprogress').text("Items Updated Successfully");
    //alert('Items Updated');
    $('#reset').show();
   
listArray();
}
 
function onUpdateFailed(sender, args)
    {   
    //alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
     $('#lblprogress').hide();
     $('#lblerror').text('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
     $('#reset').show();
    }
 
</script>

 

 

4 Replies
Highlighted
Highlighted
Highlighted

Hi @Patrick Rote, it's been a while since I did this type of thing in JS but I'll try and give you some steer.

 

When you execute your CAML query, you should get a ListItemCollection back. Iterate through that collection e.g.

 

Declare Array Variable

For Each Item in ItemCollection

Push Item.Id to your array

 

If that doesn't work, please share any specific errors that you're getting and I'll aim to help you through it

Highlighted