Skip to main content

QueryValue

  • Namespace: PPDS.Dataverse.Query
  • Assembly: PPDS.Dataverse
  • Kind: Class

Summary

Represents a value in a query result, including both the raw value and its formatted display representation.

Members

Methods

Lookup

QueryValue Lookup(Guid id, string entityType, string displayName)

Creates a lookup value with entity reference details.

Simple

QueryValue Simple(object value)

Creates a simple value with no formatting.

WithFormatting

QueryValue WithFormatting(object value, string formatted)

Creates a value with formatted display text.

Properties

FormattedValue

string FormattedValue { get; set; }

The formatted display value as a string. For lookups, this is the display name. For option sets, this is the label. For money, this includes currency formatting.

HasFormattedValue

bool HasFormattedValue { get; }

Returns true if this value has a formatted representation that differs from the raw value. Used to determine if a *name column should be expanded.

IsBoolean

bool IsBoolean { get; }

Returns true if this value represents a boolean with formatted value.

IsLookup

bool IsLookup { get; }

Returns true if this value represents a lookup (EntityReference).

IsOptionSet

bool IsOptionSet { get; }

Returns true if this value represents an optionset (integer with formatted label).

LookupEntityId

Nullable<Guid> LookupEntityId { get; set; }

For lookup values, the target record ID.

LookupEntityType

string LookupEntityType { get; set; }

For lookup values, the target entity logical name.

Null

QueryValue Null { get; }

Creates a null value.

Value

object Value { get; set; }

The raw value. Can be null, a primitive (string, int, bool, etc.), a Guid, a DateTime, or for lookups an EntityReference.