> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSTemplateVariablesParameters

> Parameters specifying source and properties for template variable substitution.

Parameters specifying source and properties for template variable substitution.

## Constructors

### NSTemplateVariablesParameters()

```crmscript theme={null}
NSTemplateVariablesParameters
```

Initializes a new instance of the NSTemplateVariablesParameters class.

## Methods

## GetAppointmentId()

```crmscript theme={null}
Integer GetAppointmentId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identifier for an appointment.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer appointmentId = thing.GetAppointmentId();
```

## GetContactId()

```crmscript theme={null}
Integer GetContactId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identifier for a contact.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer contactId = thing.GetContactId();
```

## GetCultureName()

```crmscript theme={null}
String GetCultureName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of culture to be used for culture-sensitive data, such as dates or multi-language texts.

<Note>
  Use a blank string to accept current culture that is set on the server.
</Note>

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String cultureName = thing.GetCultureName();
```

## GetCustomTags()

```crmscript theme={null}
String[] GetCustomTags()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)\[] - Array with custom tags and values. Array may be of unlimited height, but need to be exactly 2 in width.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String[] customTags = thing.GetCustomTags();
```

## GetDocumentEntity()

```crmscript theme={null}
NSDocumentEntity GetDocumentEntity()
```

**Returns:** [CRMScript.NetServer.NSDocumentEntity](CRMScript.NetServer.NSDocumentEntity) - Custom document entity to use for data retrieval.

<Note>
  Useful for unsaved data.  NSDocumentEntity.DocumentId need to match the DocumentId specified in separate property.
</Note>

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
NSDocumentEntity documentEntity = thing.GetDocumentEntity();
```

## GetDocumentId()

```crmscript theme={null}
Integer GetDocumentId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identifier for a document.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer documentId = thing.GetDocumentId();
```

## GetEncoding()

```crmscript theme={null}
Integer GetEncoding()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Encoding of source string. See \<xref href="CRMScript.NetServer.GeneratorEncoding" data-throw-if-not-resolved="false">\</xref>

<Note>
  Non-text formats such as MsWord or Excel should be Base64 encoded in the source string.
</Note>

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer encoding = thing.GetEncoding();
```

## GetPersonId()

```crmscript theme={null}
Integer GetPersonId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identifier for a person.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer personId = thing.GetPersonId();
```

## GetProductKey()

```crmscript theme={null}
String GetProductKey()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Product key.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String productKey = thing.GetProductKey();
```

## GetProjectId()

```crmscript theme={null}
Integer GetProjectId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identifier for a project.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer projectId = thing.GetProjectId();
```

## GetQuoteAlternativeId()

```crmscript theme={null}
Integer GetQuoteAlternativeId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Quote alternative Id.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer quoteAlternativeId = thing.GetQuoteAlternativeId();
```

## GetQuoteLineId()

```crmscript theme={null}
Integer GetQuoteLineId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Quote line Id.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer quoteLineId = thing.GetQuoteLineId();
```

## GetSaleId()

```crmscript theme={null}
Integer GetSaleId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identifier for a sale.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer saleId = thing.GetSaleId();
```

## GetSelectionId()

```crmscript theme={null}
Integer GetSelectionId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Identifier for a selection.

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer selectionId = thing.GetSelectionId();
```

## GetSourceInput()

```crmscript theme={null}
String GetSourceInput()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Source string to parse for template variables.

<Note>
  Such variables must have delimiters corresponding to the standard for the given generator encoding.Non-text source data (such as the binary content of a .doc file) should be passed in as Base64.
</Note>

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String sourceInput = thing.GetSourceInput();
```

## SetAppointmentId(Integer)

```crmscript theme={null}
Void SetAppointmentId(Integer appointmentId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer appointmentId;
thing.SetAppointmentId(appointmentId);
```

## SetContactId(Integer)

```crmscript theme={null}
Void SetContactId(Integer contactId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer contactId;
thing.SetContactId(contactId);
```

## SetCultureName(String)

```crmscript theme={null}
Void SetCultureName(String cultureName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String cultureName;
thing.SetCultureName(cultureName);
```

## SetCustomTags(String\[])

```crmscript theme={null}
Void SetCustomTags(String[] customTags)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String[] customTags;
thing.SetCustomTags(customTags);
```

## SetDocumentEntity(NSDocumentEntity)

```crmscript theme={null}
Void SetDocumentEntity(NSDocumentEntity documentEntity)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
NSDocumentEntity documentEntity;
thing.SetDocumentEntity(documentEntity);
```

## SetDocumentId(Integer)

```crmscript theme={null}
Void SetDocumentId(Integer documentId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer documentId;
thing.SetDocumentId(documentId);
```

## SetEncoding(Integer)

```crmscript theme={null}
Void SetEncoding(Integer encoding)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

<Note>
  Non-text formats such as MsWord or Excel should be Base64 encoded in the source string.
</Note>

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer encoding;
thing.SetEncoding(encoding);
```

## SetPersonId(Integer)

```crmscript theme={null}
Void SetPersonId(Integer personId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer personId;
thing.SetPersonId(personId);
```

## SetProductKey(String)

```crmscript theme={null}
Void SetProductKey(String productKey)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String productKey;
thing.SetProductKey(productKey);
```

## SetProjectId(Integer)

```crmscript theme={null}
Void SetProjectId(Integer projectId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer projectId;
thing.SetProjectId(projectId);
```

## SetQuoteAlternativeId(Integer)

```crmscript theme={null}
Void SetQuoteAlternativeId(Integer quoteAlternativeId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer quoteAlternativeId;
thing.SetQuoteAlternativeId(quoteAlternativeId);
```

## SetQuoteLineId(Integer)

```crmscript theme={null}
Void SetQuoteLineId(Integer quoteLineId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer quoteLineId;
thing.SetQuoteLineId(quoteLineId);
```

## SetSaleId(Integer)

```crmscript theme={null}
Void SetSaleId(Integer saleId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer saleId;
thing.SetSaleId(saleId);
```

## SetSelectionId(Integer)

```crmscript theme={null}
Void SetSelectionId(Integer selectionId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
Integer selectionId;
thing.SetSelectionId(selectionId);
```

## SetSourceInput(String)

```crmscript theme={null}
Void SetSourceInput(String sourceInput)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSTemplateVariablesParameters thing;
String sourceInput;
thing.SetSourceInput(sourceInput);
```


## Related topics

- [NSDocumentAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSDocumentAgent.md)
- [Create Default Template Variables Parameters](/en/api/reference/restful/agent/document_agent/create-default-template-variables-parameters.md)
- [SuperOffice.WebApi.Data.TemplateVariablesParameters](/en/api/reference/webapi/SuperOffice.WebApi.Data.TemplateVariablesParameters.md)
- [SuperOffice.WebApi.Agents.DocumentAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.DocumentAgent.md)
- [Substitute Template Variables](/en/api/reference/restful/agent/document_agent/substitute-template-variables.md)
- [Template variables](/en/document/templates/learn/template-variables.md)
