Skip to content

Function: getValue()

ts
function getValue(
   ctx: Context, 
   selector: string, 
options?: GetValueOptions): Promise<string>;

Defined in: src/form/form.ts:27

Return the value of a form element.

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringCSS or XPath selector for the target element.
options?GetValueOptionsOptions for waiting and querying. Supports root to specify a root element.

Returns

Promise<string>

The value of the form element as a string.

Example

ts
// Read the customer name from a CRM form
const customerName = await getValue(ctx, 'input[name="customerName"]');
console.log(`Hello, ${customerName}!`);

Matterway Assistant SDK Documentation