Skip to content

Operators

Nat Van Gulck edited this page Jul 16, 2024 · 20 revisions

JSONLogic operators

For a list of built-in JSONLogic operators see https://jsonlogic.com/operations.html.

PBI Inspector operators

PBI Inspector adds additional operators beyond those provided by the JSONLogic library.

count

Counts the number of items in an array.

diff

Venn diagram

Accepts two JSON array parameters, treats them as non-ordered sets, and returns a JSON array representing the set difference between the first and the second parameter.

drillvar

Accepts a json pointer string and parses stringified JSON on the right of a '>' character.

equalsets

Accepts two JSON array parameters, treats them as non-ordered sets, and determines if they are equal.

intersection

Venn diagram

Accepts two JSON array parameters, treat them as non-ordered sets, and returns a JSON array representing the intersection of both sets.

part

The part operator returns a PBIR folder element either in the context of the outer "part" iterator defined in the rule definition or standalone. For example the following part or parts can be returned:

  • Report: returns the part with the "report.json" file path
  • Version: returns the part with the "version.json" file path
  • Pages: returns a list of all parts with "*.page.json" file paths
  • AllVisuals: returns a list of all parts with "*.visual.json" file paths
  • Visuals: returns a list of parts with "*.visual.json" file paths in the context of the rule's own "part" iterator.
  • AllBookmarks: returns a list of all parts with "*.bookmark.json" file paths.
  • Bookmarks: returns a list of parts with "*.bookmark.json" file paths in the context of the rule's own "part" iterator.

path

[documentation in progress]

query

[documentation in progress]

rectoverlap

Accepts a JSON array of rectangle ids, x and y coordinates and width, height and optional margin width. Returns an array of overlapping rectangle ids (inflated by the margin width).

strcontains

Accepts a search string and regular expression as parameters. Returns the count of regular expression matches in the search string.

symdiff

Venn diagram

Accepts two JSON array parameters, treat them as non-ordered sets, and returns a JSON array representing the symmetric difference of both sets.

torecord

Accepts an array of key/value pairs as parameter. Return a JSON record.

tostring

Accepts a JSON node as parameter and returns the equivalent stringified JSON.

union

Venn diagram

Accepts two JSON array parameters, treat them as non-ordered sets, and returns a JSON array representing the union of both sets.

Clone this wiki locally