MCPcopy Index your code
hub / github.com/simstudioai/sim / extractFieldValues

Function extractFieldValues

apps/sim/lib/core/utils/response-format.ts:89–114  ·  view source on GitHub ↗
(
  parsedContent: any,
  selectedOutputs: string[],
  blockId: string
)

Source from the content-addressed store, hash-verified

87 * Used for both workspace and chat client field extraction
88 */
89export function extractFieldValues(
90 parsedContent: any,
91 selectedOutputs: string[],
92 blockId: string
93): Record<string, any> {
94 const extractedValues: Record<string, any> = {}
95
96 for (const outputId of selectedOutputs) {
97 const blockIdForOutput = extractBlockIdFromOutputId(outputId)
98
99 if (blockIdForOutput !== blockId) {
100 continue
101 }
102
103 const path = extractPathFromOutputId(outputId, blockIdForOutput)
104
105 if (path) {
106 const current = traverseObjectPathInternal(parsedContent, path)
107 if (current !== undefined) {
108 extractedValues[path] = current
109 }
110 }
111 }
112
113 return extractedValues
114}
115
116/**
117 * Format extracted field values for display

Callers 1

Calls 3

extractPathFromOutputIdFunction · 0.85

Tested by

no test coverage detected