Output structure

I need to change this output coming form IXP model to be formated as dctionary used in generative extraction.
IXP output:

Output needed


Activity used :Extract Document Data

Hi @Ahmed_Gamal1

If you want the output in Dictionary format follow below steps

Open Property panel
Set “Generate Data Type” to “False”
once updated to false changes the output to an IDocumentData object, it will allow you to access extracted fields using their string IDs as keys

Happy Automation

Hi @Ahmed_Gamal1

Extract Document Data (IXP) returns results as text or table values.
Generative Extraction requires Dictionary(Of String, String).
Convert the IXP output string into a Dictionary using Assign activities by parsing the extracted text (Split / Replace / Trim) and mapping values to dictionary keys before passing it to the generative extractor.

Hope it helps

Happy Automations

Hi, @Ahmed_Gamal1

  1. Create genDict as New Dictionary(Of String, Object)

  2. Assign:

genDict("name") = yourIxpOutput("Flight Table data")(0)("name")
genDict("surname") = yourIxpOutput("Flight Table data")(0)("surname")

Done! Use genDict in Extract Document Data activity.

For Multiple Rows: Use LINQ:

genDict("names") = String.Join(",", yourIxpOutput("Flight Table data").Select(Function(r) r("name")))

Hello,
Have you tried that because it doesn’t work ‘IDocumentData(Of DictionaryData)’ cannot be indexed because it has no default property.

IDocumentData(Of DictionaryData) needs .Data(“FieldName”) syntax, not direct indexing.

Hi @Ahmed_Gamal1

  • Read the extracted table values from Extract Document Data
  • Post-process them in the workflow
  • Build a Dictionary<String, String> manually
    Example: “name” → “OLIVIA EILISH”

Formatting is done after extraction, not in the IXP model.

I have solve it by creating Vb.net code that makes all extracted as Dict(string,DT)
Code if it would help someone.

ex = New Dictionary(Of String, DataTable)

Dim x=“”
For Each Table In DD.Data.GetTables
Dim newDt As New DataTable()
For Each TableValue In Table.Values

'For Each col In TableValue.ColumnInfo
	'newDt.Columns.Add(col.FieldName, GetType(String))
	'Console.WriteLine(col.FieldName)
	'Next
	For Each row In TableValue.GetRows
		Dim rowresults=row.Select(Function(w) if(not w.IsMissing,"", w.Values(0).Value))
		x=String.Join(",",rowresults)
		If row(0).IsHeader = True Then
			rowresults=row.Select(Function(w) If(w.IsMissing,"", w.Values(0).Value))
			x=String.Join(",",rowresults)
			For Each col In split(x,",")
			newDt.Columns.Add(col, GetType(String))
			Next
			Else
			newdt.Rows.Add(split(x,","))
			End If
	Next
Next 
ex(Table.FieldName)=newDt
Next

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.