Skip to main content

4. Data Access and Exploration

This section explains how to find and understand available data in ELabLIMS via the SciForge GraphQL API, provides example queries and mutations, and discusses how to map ELabLIMS data to PowerBI models. For full schema and endpoint documentation, visit the SciForge GraphQL Playground by navigating to the SciForge GraphQL endpoint in a web browser.

Finding and Understanding Available Data

The SciForge API exposes ELabLIMS data through a set of GraphQL queries and mutations. The schema and documentation are available in the GraphQL Playground, which lists all available types, fields, queries, and mutations. To explore the schema:

·         Open the SciForge GraphQL Playground: https://your-instance.sciforge.net/graphql

·         Use the Docs tab to browse available queries, mutations, and types

·         Filter or search for objects (e.g., LIM_Sample, getCustomPkl, getSampleRecdVolByMonth)

Common data objects include samples, tests, picklists, and user information. The schema documentation provides descriptions for each field and type, helping users understand the structure and relationships within ELabLIMS data.

Example Queries in GraphQL

Here are some example queries that can be used to retrieve ELabLIMS data via SciForge:

Retrieve a Custom Picklist

query {
  getCustomPkl(data: {PickListType: -1}) {
    PickListType
    PickListCode
    PickListDesc
    PickListValue
  }
}

Retrieve Samples Received by Date

query {
    getSingleSampleReceiving(input:
    {
      SAMPLERECEIVEDDTSTART:"2025-09-01",
      SAMPLERECEIVEDDTEND:"2025-10-01"
    }) {
    SAMPLEID
    SAMPLEGROUPID
    SAMPLEDETAIL1
    SPROGRAMTYPEID
    BILLABLE
    EDITEDDT
    EDITEDBY
    CREATEDDT
    CREATEDBY       
    ASSIGNEDTO
    Sample {
      SAMPLENUMBER
      SAMPLECOLLECTIONDATE
      SAMPLERECEIVED
      SampleDetails {
        SAMPLERECEIVEDDT
      }
    }
   
        }
}

Example Mutation: Create or Update a Sample

mutation ProcessSample($input: ProcessSingleSampleInputType!) {
    processSingleSampleReceiving(input:
    {
        "UpdateType": "insert",
        "SAMPLEDESCRIPTION": "Test Sample",
        "SAMPLECOMMENT": "Created via UI",
        "SAMPLEPRIORITY": 1,
        "SAMPLECOLLECTIONDATE":  "09-25-2025",
        "SAMPLECOLLECTIONBY": 1,
        "SAMPLETYPEID": 1,
        "LABID": 1,
        "SAMPLESTATUS": 1,
        "BILLABLE": true,
        "CREATEDBY": 1,
        "CREATEDDT": "09-25-2025",
        "EDITEDBY": 1,
        "EDITEDDT": "09-25-2025",
        "userID": 1,
        "locationID": 1
    })
}

The schema docs can be used to find other query or mutation names and required fields for each instance.

Some of the examples used in this paper may not be available in all client instances. In such cases, LabLynx support should be contacted.

Mapping ELabLIMS Data to PowerBI Models

When importing data from SciForge into PowerBI, users will typically:

1.      Use Power Query to call the relevant GraphQL query and retrieve data as JSON

2.      Transform the JSON response into tables using Power Query’s data shaping tools

3.      Map fields from ELabLIMS (e.g., SampleID, SampleName, ReceivedDate) to PowerBI columns

4.      Build relationships between tables (e.g., samples, tests, picklists) as needed

5.      Design the PowerBI data model to reflect the structure and relationships of laboratory data.

For complex data, the GraphQL schema documentation should be referenced to understand how objects relate and which fields are available. PowerBI’s modeling features can be used to create calculated columns, measures, and relationships that mirror laboratory workflows and reporting needs.