Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp component base.dynamicproperty.trygetvalues

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-component-base > DynamicProperty > tryGetValues

DynamicProperty.tryGetValues() method

Returns the value of the object.

Signature:

tryGetValues(): TValue[];

Returns:

TValue[]

the value associated with the dynamic property or an empty array if the source or the data doesn't exist.

Remarks

If the value is NOT an array, then an array is returned with the value being the single entry; otherwise, the value itself is returned. If the property is undefined or cannot be found, an empty array will be returned.

NOTE: This api will always return an array and it assumes that the array is homogeneous. To retrieve a non-array value, use the DynamicProperty.tryGetValue() API.

Clone this wiki locally