Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
bouky56
Partner - Contributor
Partner - Contributor

Parsing a web table in Qlik (via REST API Connection)

Dear Community,

I am struggling with parsing a table in Confluence page  into Qlik. Unfortunately, we cannot connect via "web" connection, but we have to connect to the Confluence page via REST API.

After connecting, the Qlik offers us the following code in Load Script:

RestConnectorMasterTable:
SQL SELECT
"__KEY_root",
(SELECT
"__FK_body",
"__KEY_body",
(SELECT
"value",
"__FK_storage",
"__KEY_storage",
(SELECT
"content",
"__FK__expandable"
FROM "_expandable" FK "__FK__expandable")
FROM "storage" PK "__KEY_storage" FK "__FK_storage")
FROM "body" PK "__KEY_body" FK "__FK_body")
FROM JSON (wrap on) "root" PK "__KEY_root";

[_expandable]:
LOAD [content],
[__FK__expandable] AS [__KEY_storage]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK__expandable]);


[storage]:
LOAD [value],
TextBetween([value], '<th><strong>', '</strong></th>') & '|' as "separator1",
PurgeChar([value], '<>/\') as "separator2",
replace([value], '</th>', ' |' ) as "separator3"

RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_storage]);


DROP TABLE RestConnectorMasterTable;

___________________________________________

This however reads only huge chunks of unparsed codes such as:

<h2 class="auto-cursor-target">Launched, public-facing sites</h2><p><br /></p><p class="auto-cursor-target"><br /></p><table class="wrapped"><colgroup><col style="width: 44.0px;" /><col style="width: 243.0px;" /><col style="width: 86.0px;" /><col style="width: 70.0px;" /><col style="width: 86.0px;" /><col style="width: 99.0px;" /><col style="width: 132.0px;" /><col style="width: 266.0px;" /><col style="width: 258.0px;" /><col style="width: 269.0px;" /><col style="width: 165.0px;" /><col style="width: 270.0px;" /><col style="width: 138.0px;" /><col style="width: 82.0px;" /><col style="width: 112.0px;" /><col style="width: 94.0px;" /><col style="width: 94.0px;" /></colgroup><tbody><tr><th colspan="1">#</th>
<th><strong>Website URL</strong></th><th colspan="1">Website Type</th><th colspan="1">Version</th><th colspan="1">Region</th><th colspan="1">Markets</th><th colspan="1">Person Responsible</th><th colspan="1">Contact Person</th><th colspan="1">Local Contacts</th><th colspan="1">Other Contacts</th><th colspan="1">Title of Other Contacts</th><th colspan="1">Publisher/Agency</th><th><strong>Launch Date</strong></th><th><strong>Migrated</strong></th><th><strong>Site running</strong></th><th colspan="1">NewRelic Monitor Deployed?&nbsp;</th><th><strong>Notes</strong></th></tr>
<tr><td colspan="1">1</td><td><a href="www.site1.com">site1.com</a></td><td colspan="1">Universal Theme (Microsite)</td><td colspan="1"><br /></td><td colspan="1">LA</td><td colspan="1">Latam</td><td colspan="1">Person1</td><td colspan="1"><a href="mailto:contact1@email.com">contact1@email.com</a>&nbsp;</td><td colspan="1"><p><a href="mailto:local1@email.com">local1@email.com</a>&nbsp;</p>&nbsp;</p></td><td colspan="1"><p><a href="other1@email.com">other1@email.com</a>&nbsp;</p></td>  .........

___________________________________

Our desired solution is to end up with a table such as this :

bouky56_0-1666452118582.png

 

Any thoughts? I will be glad to provide more details.

Many thanks in advance.

Best,
Tomas

Labels (1)
0 Replies