@@ -39,11 +39,13 @@ function resolveCodeVariables(
3939 resolvedCode = resolvedCode . replace ( new RegExp ( escapeRegExp ( match ) , 'g' ) , safeVarName )
4040 }
4141
42- // Resolve tags with <tag_name> syntax
43- const tagMatches = resolvedCode . match ( / < ( [ a - z A - Z _ ] [ a - z A - Z 0 - 9 _ ] * ) > / g) || [ ]
42+ // Resolve tags with <tag_name> syntax (including nested paths like <block.response.data>)
43+ const tagMatches = resolvedCode . match ( / < ( [ a - z A - Z _ ] [ a - z A - Z 0 - 9 _ . ] * [ a - z A - Z 0 - 9 _ ] ) > / g) || [ ]
4444 for ( const match of tagMatches ) {
4545 const tagName = match . slice ( 1 , - 1 ) . trim ( )
46- const tagValue = params [ tagName ] || ''
46+
47+ // Handle nested paths like "getrecord.response.data"
48+ const tagValue = getNestedValue ( params , tagName ) || ''
4749
4850 // Instead of injecting large JSON directly, create a variable reference
4951 const safeVarName = `__tag_${ tagName . replace ( / [ ^ a - z A - Z 0 - 9 _ ] / g, '_' ) } `
@@ -56,6 +58,17 @@ function resolveCodeVariables(
5658 return { resolvedCode, contextVariables }
5759}
5860
61+ /**
62+ * Get nested value from object using dot notation path
63+ */
64+ function getNestedValue ( obj : any , path : string ) : any {
65+ if ( ! obj || ! path ) return undefined
66+
67+ return path . split ( '.' ) . reduce ( ( current , key ) => {
68+ return current && typeof current === 'object' ? current [ key ] : undefined
69+ } , obj )
70+ }
71+
5972/**
6073 * Escape special regex characters in a string
6174 */
0 commit comments