Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • This API is used to query records from a particular object

  • API queries records from the standard, custom , and metadata type object only if the user has the required access

  • HTTP method: POST

  • Base URL: https://api-{warehouse}.pwrapps.com

  • Endpoint: /data/v1/{instance}/{workspace}/query

...

  • You can apply conditions to filter records to be queried

  • Conditions in the filters consist of leftfieldleftField, rightfieldrightField, operator, isNot, and conditions

  • The left field is the object that contains fieldsOptions: {name: "fieldName"} where fieldName is the field on which the condition is applied

  • The right field is the object that contains fieldsOptions: {value: fieldvalue} where fieldValue is the value for which the record will be searched

  • Operators can be equals/eq, notEquals/ne, lessThan/lt, greaterThan/gt, lessThanEqualTo/lte, greaterThanEqualTo/gte, contains/c, startsWith/sw, endsWith/ew, in, notIn, match/mt, btw, any, as per the field type selected in the left field

  • isNot accepts a boolean value.

  • If isNot is true, then it will filter not of the given condition, else will filter as per the given condition

  • conditions Conditions inside the conditions act as sub-conditions of the filter

  • Evaluation criteria are the logical operators to combine two or more conditions with “and” & “or”, conditions are combined with “and“ by default

...

  • Grouping contains the groupByFields and aggregationFields fields

    • The records are grouped by the fields provided in the groupByFields array

    • The aggregationFields is an array of objects where each object contains an operator, field, and name

      • Operator value can be sum, min, max, count , or avg

  • Based on the aggregation operation, this field contains the name of the field on which the aggregation operation needs to be performed

...

  • showCount accepts a boolean value

  • If showCount is true, then the query shows the count of records retrieved

  • If showCount is false, then the query does not show the count of records retrieved

operators:

Operator Label

Positive Operator Name

Equals

eq, =

notEquals

ne, !=

Contains

c

Starts With

sw

Ends With

ew

In

in

Less Than

lt, >

Greater Than

gt, <

Less Than Equals

lte, >=

Greater Than Equals

get, <=

Between

btw

Match

mt

All Of

all

Any Of

any

None Of

none

Exactly

exactly

during

during

...

  • The period Component query is only applicable for Date and DateTime fields.

  • The value type used in the period query are as follows

    • custom

      • If we set the value type custom then we have to give the value

      • ex. {valueType: custom, value: “2023-06-24”}

    • relative

      • If we set the value type relative then it will take the value as the current date and time

  • The operators used in a period component query are as follows

    • equals

    • greaterThan

    • greaterThanEquals

    • lessThan

    • lessThanequals

    • current

    • next

    • currentAndNext

    • previous

    • currentAndPrevious

    • during

  • Fiscal Year and Fiscal Quarter

    • You can set the fiscal year on the instance using the field FYYearStartMonth

    • For example, you set FYYearStartMoth:

      • { label: “Mar”, value:3}

    • Then your fiscal year will start to in March to Feb

Period Units

...

  • The period units used in the period component query are as follows

    • milliseconds

    • seconds

    • minutes

    • hours

    • days: n

      • If conditions: { periodUnit: days, periodCount: 'n'}

        • It will return the records which are created between the current date to 'n' days

      • If conditions: { periodUnit: days, periodCount: -'n'}

      • It will return the records which are created from the 'n' days prior to the current date

    • weeks: n

      • If conditions: { createdOn: "weeks:n"}

        • It will return the records which are created between the current week to 'n' weeks

      • If conditions: { createdOn: "weeks:-n"}

        • It will return the records which are created from the 'n' weeks prior to the current week

    • months: n

      • If conditions: { createdOn: "weeks:n"}

        • It will return the records which are created between the current month to 'n' months

      • If conditions: { createdOn: "weeks:-n"}

        • It will return the records which are created from the 'n' months prior to the current month

    • calQuarters: n (calendar quarter)

      • If conditions: { createdOn: "calQuarters:n"}

        • It will return the records which are created between the current calendar quarter to 'n' calendar quarters

      • If conditions: { createdOn: "calQuarters:n"}

        • It will return the records which are created from the 'n' calendar quarter prior to the current calendar quarter till the current calendar quarter

    • fYQuarters: n (financial quatrer)

      • If conditions: { createdOn: "fYQuarters:n"}

        • It will return the records which are created between the current financial quarter to 'n' financial quarters

      • If conditions: { createdOn: "fYQuarters:n"}

        • It will return the records which are created from the 'n' financial quarter prior to the current financial quarter till the current financial quarter

    • calYears: n (current calendar year)

      • If conditions: { createdOn: "calYears:n"}

        • It will return the records which are created between the current calendar year to 'n' calendar years

      • If conditions: { createdOn: "calYears:n"}

        • It will return the records which are created from the 'n' calendar year prior to the current calendar year till the current calendar year

    • fYYears: n (current financial year)

      • If conditions: { createdOn: "fYYears:n"}

        • It will return the records which are created between the current financial year to 'n' financial years

      • If conditions: { createdOn: "fYYears:n"}

        • It will return the records which are created from the 'n' financial year prior to the current financial year till the current financial year

...