Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have searched forums and tried different variations of code examples I have found, but have been unable to get this to work and need help figuring out why.
I have a webquery which returns a list of scripts with xml field of all the script attributes. i need to parse out that xml into columns while maintaining the association to the script name.
Sample Data attached.
I cannot figure out how to parse the XML into columns. I've tried the below, but the association is lost when sub tables are created.
Scripts_Main:
LOAD
[name] as IVRScript_name,
xmlDefinition as IVRDetailsXml,
RESIDENT RestConnectorMasterTable
;
//
ivrPlayAnnouncements:
LOAD
moduleName as [play/moduleName],
[data/prompt/filePrompt/promptData/prompt/id] as [promptData/prompt/id],
[data/prompt/filePrompt/promptData/prompt/name] as [promptData/prompt/name],
RowNo() as %Key_ivrScript_6360329EA3A83B72 // Key to parent table: ivrScript
From_Field (Scripts_Main,IVRDetailsXml)(XmlSimple, Table is [ivrScript/modules/play]);
ivrInQueueAnnouncements:
LOAD
//[modules/incomingCall/moduleId] & '-' & RowNo() as %Key_ivrScript_6360329EA3A83B72 ,
[prompt/id] as [announcements/prompt/id],
[prompt/name] as [announcements/prompt/name],
RowNo() as %Key_ivrScript_6360329EA3A83B72 // Key to parent table: ivrScript
From_Field (Scripts_Main,IVRDetailsXml)(XmlSimple, Table is [ivrScript/modules/skillTransfer/data/announcements]);
ivrScript:
LOAD
//[modules/incomingCall/moduleId] & '-' & RowNo() as %Key_ivrScript_6360329EA3A83B72 ,
RowNo() as RecNo,
domainId,
defaultLanguage as [ivrScript/defaultLanguage],
defaultMethod,
defaultFetchTimeout,
showLabelNames,
defaultVivrTimeout,
unicodeEncoding,
useShortcut,
resetErrorCode,
showAllChannelPrompts,
extContactFieldsInput,
extContactFieldsOutput,
useIvrTimeZoneInAssignment,
timeoutInMilliseconds,
version,
RowNo() as %Key_ivrScript_6360329EA3A83B72 // Key for this table: ivrScript
From_Field (Scripts_Main,IVRDetailsXml)(XmlSimple, Table is [ivrScript]);
Any help would be appreciated.