I need help filtering array values that contain the phrase 'Corp'
Currently, all values are being returned, but I only want the ones with "Corp"
var url = "/iaas/api/image-profiles";
System.debug("getImageProfiles url: "+url);
var response=System.getModule("pso.vra.util.rest").genericRestAPI(url,null,null);
var responseJSON=JSON.parse(response.contentAsString);
System.log("Response : "+JSON.stringify(responseJSON));
var imageProfilesContent=responseJSON.content;
var imageProfiles = [];
System.log("Checking : "+Object.keys(responseJSON.content[0].imageMappings.mapping));
var imageProfiles = JSON.stringify(Object.keys(responseJSON.content[0].imageMappings.mapping));
System.log(imageProfiles);
return JSON.parse(imageProfiles);
0 Windows Server 2022
1 Windows Server 2019
2 Windows Server 2022 - Corp
3 Windows Server 2019 - Corp
4 Rhel8 - Corp
5 Rhel8
...
I attempted to use filter() without success.