Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
angmarceau1971
Contributor II
Contributor II

XML Parsing of Data from WebQuery. XML in one Field

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.

0 Replies