LogoLogo
HomeNewsSupportVideos
  • Welcome
  • Wisej.NET
  • Concepts
    • Getting Started
    • General Concepts
    • Architecture
    • Extensibility
    • AI Providers
    • Vector Databases
    • Usage Metrics
    • Logging & Error Handling
  • Markup
  • Components
    • API
      • SmartAdapter
        • SmartAudioTTSAdapter
        • SmartAudioWhisperAdapter
        • SmartCalendarAdapter
        • SmartChartAdapter
        • SmartChartJS3Adapter
        • SmartChatBoxAdapter
        • SmartComboBoxAdapter
        • SmartCopilotAdapter
        • SmartDataEntryAdapter
        • SmartDocumentAdapter
        • SmartFullCalendarAdapter
        • SmartObjectAdapter
        • SmartPictureBoxAdapter
        • SmartQueryAdapter
        • SmartRealtimeAdapter
        • SmartReportAdapter
        • SmartTextBoxAdapter
        • SmartAdapter.ExtendsAttribute
        • SmartAdapter.FieldNameAttribute
        • SmartAdapter.FieldPromptAttribute
        • SmartAdapter.FieldRectangleAttribute
        • SmartAdapter.WorksWithAttribute
      • SmartEndpoint
        • AmazonBedrockEndpoint
        • AnthropicEndpoint
        • AzureAIEndpoint
        • CerebrasEndpoint
        • DeepSeekEndpoint
        • GoogleAIEndpoint
        • GroqCloudEndpoint
        • GroqCloudEndpointWhisper
        • HuggingFaceEndpoint
        • HuggingFaceJavaScriptEndpoint
        • LocalAIEndpoint
        • LocalAIEndpointImageGen
        • LocalAIEndpointTTS
        • LocalAIEndpointWhisper
        • NvidiaAIEndpoint
        • OllamaEndpoint
        • OpenAIEndpoint
        • OpenAIEndpointDallE
        • OpenAIEndpointRealtime
        • OpenAIEndpointTTS
        • OpenAIEndpointWhisper
        • SambaNovaEndpoint
        • SmartHttpEndpoint
        • TogetherAIEndpoint
        • XAIEndpoint
        • SmartEndpoint.Metrics
        • SmartEndpoint.Response
      • SmartExtensions
      • SmartHub
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartObject
      • SmartPrompt
        • SmartAgentPrompt
        • SmartParallelPrompt
        • SmartPrompt.Parameter
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartRealtimeSession
      • SmartSession
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.Message
        • SmartSession.MessageCollection
        • SmartSession.MessageRole
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
        • SmartSession.TrimmingStrategy
      • SmartTool
        • SmartTool.IToolProvider
        • SmartTool.ToolAttribute
        • SmartTool.ToolContext
      • Markup
        • MarkupExtensions
      • Controls
        • UVLightOverlay
      • Embeddings
        • EmbeddedDocument
        • Embedding
        • Matches
        • Metadata
      • Helpers
        • ApiKeys
        • Markdown
        • TextTokenizer
      • Services
        • DefaultSessionTrimmingService
        • IDocumentConversionService
          • DefaultDocumentConversionService
        • IEmbeddingGenerationService
          • DefaultEmbeddingGenerationService
          • HuggingFaceEmbeddingGenerationService
        • IEmbeddingStorageService
          • AzureAISearchEmbeddingStorageService
          • ChromaEmbeddingStorageService
          • FileSystemEmbeddingStorageService
          • MemoryEmbeddingStorageService
          • PineconeEmbeddingStorageService
          • QdrantEmbeddingStorageService
        • IHttpClientService
          • DefaultHttpClientService
        • ILoggerService
          • DefaultLoggerService
        • IOCRService
          • DefaultOCRService
        • IRerankingService
          • DefaultRerankingService
          • LocalAIRerankingService
          • PineconeRerankingService
        • ISessionTrimmingService
          • DefaultSessionTrimmingService
        • ITextSplitterService
          • RecursiveCharacterTextSplitterService
          • TextSplitterServiceBase
        • ITokenizerService
          • DefaultTokenizerService
        • IWebSearchService
          • BingWebSearchService
          • BraveWebSearchService
          • GoogleWebSearchService
      • Tools
        • ArxivTools
        • ChartJS3Tools
        • DatabaseTools
        • DataTableFilterTools
        • DocumentSearchTools
        • DocumentTools
        • FullCalendarTools
        • IToolsContainer
        • MathTools
        • ToolsContainer
        • UtilityTools
        • WebSearchTools
    • Built-in Services
      • IOCRService
      • ILoggerService
      • ITextSplitterService
      • ITokenizerService
      • IHttpClientService
      • IWebSearchService
      • IRerankingService
      • ISessionTrimmingService
      • IDocumentConversionService
      • IEmbeddingStorageService
      • IEmbeddingGenerationService
    • Built-in SmartTools
      • ToolsContainer
      • MathTools
      • UtilityTools
      • DatabaseTools
      • DocumentTools
      • DocumentSearchTools
      • WebSearchTools
      • ChartJS3Tools
      • FullCalendarTools
    • Built-in SmartAdapters
      • SmartAdapter
      • SmartAudioTTSAdapter
      • SmartAudioWhisperAdapter
      • SmartCalendarAdapter
      • SmartChartAdapter
      • SmartChartJS3Adapter
      • SmartChatBoxAdapter
      • SmartComboBoxAdapter
      • SmartCopilotAdapter
      • SmartDataEntryAdapter
      • SmartDocumentAdapter
      • SmartFullCalendarAdapter
      • SmartObjectAdapter
      • SmartPictureBoxAdapter
      • SmartQueryAdapter
      • SmartRealtimeAdapter
      • SmartReportAdapter
      • SmartTextBoxAdapter
    • Configure Services
    • Using SmartHub
    • Using SmartTools
    • Using SmartPrompt
    • Using SmartSession
    • Using SmartRealTimeAdapter
    • UVLightOverlay Control
Powered by GitBook
On this page
  • Overview
  • Configuration
  • Properties
  • UseOCR
  • ExcludeReadOnly
  • Extender Properties
  • FieldName
  • FieldPrompt
  • FieldRectangle
  • Methods
  • FromTextAsync
  • FromImageAsync
  • FromStreamAsync
  • FromClipboardAsync
  • Events
  • ParseValue
  • UpdateField
Export as PDF
  1. Components
  2. Built-in SmartAdapters

SmartDataEntryAdapter

PreviousSmartCopilotAdapterNextSmartDocumentAdapter

Last updated 3 days ago

Overview

The SmartDataEntry adapter enhances all controls within supported containers—including GroupBox, Panel, Form, Page, and UserControl—with automatic data extraction capabilities powered by AI. This means that all controls inside these containers benefit from intelligent data entry features, significantly improving efficiency and accuracy in data handling within your applications.

The SmartDataEntry adapter operates by introducing design-time properties to all controls within a container. To utilize this functionality, the first step is to associate the adapter with a specific container (see ). Once this association is established, every child control within the container will display three new AI properties: FieldName, FieldPrompt, and FieldRectangle.

These properties are analogous to the FieldName, FieldPrompt, and FieldRectangle attributes employed by the .

Use the properties FieldName, FieldPrompt, and FieldRectangle to help the AI model identify what type of data to extract and the process for doing it.

For example, the design properties below illustrate how textBox6 is set up to automatically extract the "Website URL" from unstructured data. Additionally, if the URL is missing, it can deduce it from other available information.

The adapter also supports tabular data, allowing you to set FieldName and FieldPrompt on a DataGridView as well as on each individual column.

The supported controls include:

  • CheckBox

  • RadioButton

  • NumericUpDown

  • TrackBar

  • ProgressBar

  • ListBox

  • DataGridView (DataGridColumn)

  • ComboBox

  • TextBox

  • Any other control that has a Text property

When populating a DataGridView, the adapter can either create new rows directly within the DataGridView or fill data into the associated DataSource.

Please note that currently, ListView and DataRepeater controls are not supported by the adapter.

Configuration

[Extends(typeof(Panel), allowMultiple: true)]
[Extends(typeof(GroupBox), allowMultiple: true)]
[Extends(typeof(ContainerControl), allowMultiple: true)]

Properties

UseOCR

Conversely, when UseOcr is set to false, which is the default setting, the image data is forwarded to the AI model, which is expected to possess vision capabilities to handle the image processing tasks.

ExcludeReadOnly

When ExcludeReadOnly is set to true, any control with the ReadOnly property enabled will be bypassed during the data extraction process.

Extender Properties

All the extender properties are optional. Wisej.AI can use the control name, if descriptive enough, without additional information.

FieldName

Assigns a specific name to the field for the data extraction prompt. This is important for clarifying the purpose of a field. For instance, consider fields named nameTextBox, textBoxName, or tbName. The label "Name" can be ambiguous, potentially referring to a first name, last name, or a full name. By setting the FieldName property to something explicit like "First Name," you help the AI model accurately identify and assign the correct data to the field.

FieldPrompt

FieldPrompt contains additional instructions for the model concerning the control. For example, when extracting a phone number, you can specify the desired format ("Always use (999) 999-9999") or provide instructions to help the AI pinpoint the data ("The reference appears after Your Ref: or just Ref:"). These instructions enhance the AI's ability to accurately format and isolate the correct data.

FieldRectangle

FieldRectangle is applicable only when extracting data from an image. It defines an optional rectangle used to crop the image, assisting the AI model in concentrating on a specific area. The rectangle can be configured using the built-in editor provided below.

You can use the same rectangle for multiple fields. Wisej.AI internally groups controls sharing the same rectangle and optimizes the requests to the AI model.

Methods

FromTextAsync

This function fills the "smart" controls from the given text.

var invoice = await adapter.FromTextAsync<invoice>(text);

// or

var invoice = (Invoice)(await adapter.FromTextAsync(text, typeof(Invoice));)

FromImageAsync

This function fills the "smart" controls from the specified image.

var invoice = await adapter.FromImageAsync<invoice>(image);

// or

var invoice = (Invoice)(await adapter.FromImageAsync(image, typeof(Invoice));)

FromStreamAsync

This function fills the "smart" controls the specified stream.

The final parameter is the content type, and it is optional. If not specified, Wisej.AI will attempt to autodetect the content type from the following options: PDF, PNG, JPG, BMP, GIF, and DOCX. If autodetection fails, it will default to TXT.

var invoice = await adapter.FromStreamAsync<invoice>(File.OpenRead("Invoice.pdf"));
var invoice = await adapter.FromStreamAsync<invoice>(File.OpenRead("Invoice.pdf"), ".pdf");

// or

var invoice = (Invoice)(await adapter.FromStreamAsync(image, typeof(Invoice), File.OpenRead("Invoice.pdf"));)

FromClipboardAsync

This function fills the "smart" controls from the content of the clipboard. It supports both text and image conversions.

var invoice = await adapter.FromClipboardAsync<invoice>();

// or

var invoice = (Invoice)(await adapter.FromClipboardAsync(typeof(Invoice));)

Please be aware that the web page must be in focus for the browser to access and read the clipboard contents.

Events

ParseValue

This event is triggered once the AI model has successfully extracted all values from the input unstructured data, but before it attempts at converting the value to match the DesiredType. It provides the application an opportunity to inspect and modify the extracted values if necessary.

Name
Description

e.Value

The value extracted by the AI model. You can change it handling this event.

e.Control

The control that will be assigned the parsed value.

e.DesiredType

The desired type of the parsed value.

UpdateField

This event is triggered before the adapter assigns a value to the control. By handling this event and setting e.Handle to true, you can override the default behavior and take control of updating the control manually.

Name
Description

e.Value

The value to be assigned to the e.Control. Read only.

e.Control

The control that is about to receive the e.Value. Read only.

To use this adapter, you have access to a few straightforward to initiate the extraction process. These methods can extract data from text, an image, a stream (which may contain either a document or an image), and from the clipboard (which can contain text or an image).

In addition to the properties inherited from the , the SmartDataEntryAdapter exposes the following additional properties.

The UseOCR property determines whether Optical Character Recognition (OCR) service should be used for processing images. When this property is set to true, Wisej.AI utilizes the to carry out OCR operations, with the implementation leveraging Wisej.NET's Tesseract extension to perform OCR directly in the user's browser.

SmartAdapter
IOCRService
DefaultOCRService
methods
SmartObjectAdapter
Adding AI Features to Your Application