Flow action complex data values remain static when looping through a GlideRecordIssue Issue Definition: Flow flow output complex data remain static while looping through GlideRecordThis was replicated and tested in an out of the box instance Steps to Reproduce: 1. Login to an instance2. Navigate to Flow designer3. Create a new action and add a Script step activity that is looping through a GlideRecord (similar to below) (function execute(inputs, outputs) { var recordLimit = inputs.record_limit; var portfolios = []; var portfolioGR = new GlideRecord("alm_hardware"); //asset_tagLIKEP100 portfolioGR.addEncodedQuery("asset_tagLIKEP100"); //portfolioGR.addQuery('po_number', 'STARTSWITH', inputs.po_number); portfolioGR.setLimit(recordLimit); portfolioGR.query(); var recCount = 0; while (portfolioGR.next()){ var portfolio = {}; gs.info("myk glide record output: " + portfolioGR.sys_id); portfolio.sys_id = portfolioGR.sys_id; portfolio.real_sys_id = portfolioGR.sys_id + ""; portfolio.serial_number = portfolioGR.serial_number; portfolio.real_serial_number = portfolioGR.serial_number + ""; portfolio.asset_tag = portfolioGR.asset_tag; portfolio.real_asset_tag = portfolioGR.asset_tag + ""; portfolios.push(portfolio); recCount++; } outputs.portfolios = portfolios; })(inputs, outputs); 5. Setup the output complex data structure as per the code above.6. Test the action (input record limit as 3, this will retrieve 3 record)3. Go to flow execution context for your test and view the output object Notice that the output the field remain static for all 3 records, except for the fields that has real_* on it.Please notice how the real_* fields is assigned on the script. It works ok if you add a empty string which is not ideal. sample output: { "Portfolio Records": [ { "asset_tag": "P1000807", "real_asset_tag": "P1000479", "real_serial_number": "BQP-854-D33246-GH", "real_sys_id": "00a96c0d3790200044e0bfc8bcbe5dc3", "serial_number": "IKS-131-F44462-HL", "sys_id": "01a92c0d3790200044e0bfc8bcbe5d36" }, { "asset_tag": "P1000807", "real_asset_tag": "P1000241", "real_serial_number": "56WHL71", "real_sys_id": "0196612a37c4200044e0bfc8bcbe5d3a", "serial_number": "IKS-131-F44462-HL", "sys_id": "01a92c0d3790200044e0bfc8bcbe5d36" }, { "asset_tag": "P1000807", "real_asset_tag": "P1000807", "real_serial_number": "IKS-131-F44462-HL", "real_sys_id": "01a92c0d3790200044e0bfc8bcbe5d36", "serial_number": "IKS-131-F44462-HL", "sys_id": "01a92c0d3790200044e0bfc8bcbe5d36" } ] } ReleaseAnyCauseThis is due to GlideRecord is a pointer and accessing the field directly would just return the last value that is set.ResolutionThe getValue() API is documented way of accessing the field values and seems the direct reference is a convenience that is limited to the table's own fields. The getValue() is to be used to fetch the inherited field values." You can change the code inside the loop like the below portfolio.sys_id = portfolioGR.getValue("sys_id"); portfolio.serial_number = portfolioGR.getValue("serial_number"); portfolio.asset_tag = portfolioGR.getValue("asset_tag"); Please note that as a best practice method of accessing a field within a GlideRecord it is always good to use the getValue() function. Please check the following community link which actually best explains the scenario we had found out on the script: Get field value of GlideRecord (best practice method)