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

sp core library.urlqueryparametercollection.getvalue

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

Home > @microsoft/sp-core-library > UrlQueryParameterCollection > getValue

UrlQueryParameterCollection.getValue() method

Returns the value of the first matching query parameter or undefined if the key doesn't exist.

Signature:

getValue(param: string): string | undefined;

Parameters

Parameter Type Description
param string the case insensitive key for the desired query parameter value.

Returns:

string | undefined

Remarks

Examples:

this._queryParameterList = [
{key: TEST, value: done},
{key: DEBUG, value: false},
{key: TEST, value: notdone}]
  getValue('TEST') ---> 'done'
  getValue('debug')  ---> 'false'
  getValue('lost')  ---> undefined

Clone this wiki locally