Hopefully someone can help me correct the below code. I am not able to get anything in the final return statement. I know it looks messy as I have tried a few alternatives.
async function concatnames(allSelectedRows){ var flightName = []; var name = ""; var resultOutCome = ""; try { var result = await allSelectedRows.forEach( function (selectedRow, i){ recordidGuid = selectedRow.getData().getEntity().getEntityReference().id.replace('{', '').replace('}', '') //Flight Plan Event Guid name = Xrm.WebApi.online.retrieveRecord("crd80_flightplanevent", recordidGuid, "?$select=_crd80_learnerflight_value") }) resultOutCome = name["_crd80_learnerflight_value@OData.Community.Display.V1.FormattedValue"] console.log(resultOutCome) flightName.push(resultOutCome); } catch (error) { DisplayError(error) } return flightName }