Intune Data Stream issue

Tanmay14
Tera Contributor

Hello,

 

I am trying to fetch physicalMemoryInBytes details for a device from Intune but it always returns 0. You have to query for it explicitly by using select, otherwise you will always get back 0.

For this I am trying to invoke a custom data stream from script include by passing required inputs in an objectand triggering the data stream with below command:

 

sn_fd.FlowAPI.getRunner().datastream('sn_intune_integrat.computerRAM').withInputs(computerRAMInputs).run();

 

Here “computerRAM” is the data stream and “computerRAMInputs” is an input object containing Intune credentials, baseURL, api_version and id. Id is the device id for which to get physicalMemoryInBytes details.

 

The syntax for this should be :

/beta/deviceManagement/manageddevices(<id here>)?$select=id,physicalMemoryInBytes

 

Ref - https://techcommunity.microsoft.com/discussions/microsoft-intune/physicalmemoryinbytes-always-return...

 

Every time I’m trying to trigger this data stream, I get this error:

 

org.mozilla.javascript.JavaScriptException: java.lang.IllegalArgumentException: flow object does not exist (sys_script_include.6a4e0342773310102dfb23446810611c.script; line 683)

 

Even when directly testing the data stream I notice that the nextLink is not showing any value even though I’m setting is from Pagination Variables Script:

 

   if (!gs.nil(variables.nextLink)){

        variables.nextLink =  variables.nextLink.replace(variables.baseUrl, '');

        variables.getNextPage = true;

    } else {

        variables.nextLink =  "/v1.0/beta/deviceManagement/manageddevices("+variables.id+")?$select=id,physicalMemoryInBytes";

        variables.getNextPage = false;

    }

 

Test flow throws this error:

 

Failed to iterate on data stream: com.glide.transform.transformer.exceptions.InvalidStructureException: JsonStreamParser[2]: JSON must be an object or an array: '<'

 

Am I missing out on anything

0 REPLIES 0