New-UDHTML not working as expected

Hi Folks,

Summary: Trying to use the New-UDHTML command to display the contents of a pre-existing html file.

Basically, i have a number of html files generated by a seperate PS script, that are named by business unit (BU) and date, i need the end-user to select the BU of interest (for now date is hard-coded to today) then open up the appropriate html file.

Example that works, without any BU selection option (Just to test New-UDHTML):
HTML file is opened and displayed in UD window.
$Dashboard3 = New-UDDashboard -Title “Test” -Content {
$cache:CurrentYYMMDD = (Get-Date -format yyyy-MM-dd)
$BUSelect = “BU”
$O365LicenseFolderCSVs = “\<Share>”
$global:HTMLFile1 = $O365LicenseFolderCSVs + “” + $cache:CurrentYYMMDD + “” + $BUSelect + “” + $BUSelect + “-LicenseReport_All_Overview.html”
$global:HTMLFileContent1 = Get-Content $global:HTMLFile1
New-UDHtml -Markup $global:HTMLFileContent1
}

Example of a page that fails (does nothing other than allow select then displays the toast), with a selection option:
$PageLicensesBUDetail = New-UDPage -Name “O365LicensesBUDetail” -Icon Link -Content {
$Cache:CurrentYYMMDD = (Get-Date -format yyyy-MM-dd)
New-UDRow -Columns {
New-UDColumn -size 5 -Content {
New-UDCard -BackgroundColor “#8789c0” -Content {
New-UDInput -Title "Business Unit " -Id ‘BUSelect’ -Content {
New-UDInputField -Type ‘select’ -Name ‘BUSelect’ -PlaceHolder ‘Select Business Unit’ -Values @(“BU1”,“BU2”,“BU3”,“BU4”,“BU5”)
} -Endpoint {

param($BUSelect)

              Show-UDToast -Message "You have Selected: $BUSelect" -Duration 5000 -Position topLeft -BackgroundColor red -MessageColor white   
              New-UDCard -Title "blah blah" -Content {
                Function-Write-Log "New-UDCard-1"
                $O365LicenseFolderCSVs   = "\\<Server>\<Share>"
                $global:HTMLFile1        = $O365LicenseFolderCSVs + "\" + $Cache:CurrentYYMMDD + "\" + $BUSelect + "\" + $BUSelect + "-LicenseReport_All_Overview.html"
                $global:HTMLFileContent1 = Get-Content $global:HTMLFile1
                Function-Write-Log "Folder:   $O365LicenseFolderCSVs"
                Function-Write-Log "HTMLFile: $global:HTMLFile1"
                New-UDHtml -Markup $global:HTMLFileContent1
              }
            }
        }
    }
}

}

My log file is showing all correct entries, that when used directly in ie or explorer work as expected (file present and displayed)
20201118_121711 HTMLFile: \<Share>\2020-11-18\BU1\BU1-LicenseReport_All_Overview.html

For some reason the New-UDHTML command is not being actioned.

Any thoughts would be much appreciated.

Regards

Have you tried this in an -Endpont script block to make it dynamic?

Hi Thanks for coming back to me - perhaps have I misunderstood your reply regarding dynamic endpoint? is the code i have posted not already using a dynamics endpoint? I can see it looks to have gotten unformatted for some reason in the cut/paste procedure, just before the show-udtoast command, from my understanding the endpoint is valid?

I have previously tried it with the endpoint calling a function (script block) - but same issue.

Function Func-PageScriptBlock{

param($BUSelect)

              Show-UDToast -Message "You have Selected: $BUSelect" -Duration 5000 -Position topLeft -BackgroundColor red -MessageColor white   
              New-UDCard -Title "blah blah" -Content {
                Function-Write-Log "New-UDCard-1"
                $O365LicenseFolderCSVs   = "\\<Server>\<Share>"
                $global:HTMLFile1        = $O365LicenseFolderCSVs + "\" + $Cache:CurrentYYMMDD + "\" + $BUSelect + "\" + $BUSelect + "-LicenseReport_All_Overview.html"
                $global:HTMLFileContent1 = Get-Content $global:HTMLFile1
                Function-Write-Log "Folder:   $O365LicenseFolderCSVs"
                Function-Write-Log "HTMLFile: $global:HTMLFile1"
                New-UDHtml -Markup $global:HTMLFileContent1
              }

}

$PageLicensesBUDetail2 = New-UDPage -Name “O365LicensesBUDetail” -Icon Link -Content {
$Cache:CurrentYYMMDD = (Get-Date -format yyyy-MM-dd)
New-UDRow -Columns {
New-UDColumn -size 5 -Content {
New-UDCard -BackgroundColor “#8789c0” -Content {
New-UDInput -Title "Business Unit " -Id ‘BUSelect’ -Content {
New-UDInputField -Type ‘select’ -Name ‘BUSelect’ -PlaceHolder ‘Select Business Unit’ -Values @(“BU1”,“BU2”,“BU3”,“BU4”,“BU5”)
} -Endpoint {
Func-PageScriptBlock
}
}
}
}
}

Hi, I have gotten the UD Logging enabled and have the output file (.txt) available - probably too big to cut/paste here, but i can forward it if you think it may help?

Forum wont allow me to upload the txt file…

Many Thanks

You cool to post what product you using and the version please. Like I use Universal Dashboard 2.8.1 just could cook up an equivalent example is all…Just from what I read Powershell Universal is a tad different.

Hi,
Yes, apologies I should have included that… Universal Dashboard Community edition v2.9.0
Thanks

Just explain that the New-UDHTML only accepts basic markup…so if this is complex markup it will not work.

Hi, thanks for the update, I wont profess to be a HTML guru, but i have tested HTML file contents using the New-UDHTML command as a specific command on a dashboard page and that opens fine, issue appears to be with New-UDHTML operating inside an page endpoint. I have enabled ud logging, and i can see where the new-udhtml is processing the HTML file, the relevant portion looks like below:

Apologies for dumping it here - cant see a way to attached a txt file.

15:02:06 [Debug] NewElementCommand HTML
15:02:06 [Debug] NewElementCommand HTML
15:02:06 [Debug] NewElementCommand HTML
15:02:06 [Debug] NewElementCommand {“tag”:“span”,“attributes”:{“className”:“card-title left-align “},“events”:[],“content”:[“blah blah”],“type”:“element”,“key”:“cfa9b4e4-6cec-4a8d-a144-188a2e7428d4”,“onMount”:null,“id”:“3aa9734e-556d-409c-9508-6530e27e2d07”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}
15:02:06 [Debug] NewElementCommand HTML
15:02:07 [Debug] NewHtmlCommand {“markup”:“This is the overview of CAS current Office365 license usage on 11/19/2020 1:30 AM
<html xmlns=“http://www.w3.org/1999/xhtml”> TABLE{border-collapse:collapse;border-spacing:0;border-color:#aaa;}td{font-family:Arial, sans-serif;font-size:12px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;border-top-width:1px;border-bottom-width:1px;}th{font-family:Arial, sans-serif;font-size:12px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;border-top-width:1px;border-bottom-width:1px;}

CAS Dynamics 365 Customer Engagement Plan Exchange Online Plan 1 Microsoft 365 E3 Office 365 E3 Power BI Pro Project Online Essentials Project Online Professional Project Online Premium Visio Online Plan 2 Dynamics 365 Customer Service Professional Dynamics 365 Plan Dynamics 365 Project Operations Dynamics 365 Sales Enterprise Edition Dynamics 365 for Talent Dynamics 365 Team Members Dynamics 365 Unified Operations Plan Dynamics 365 Unified Operations Activity Enterprise Mobility Security E5 Microsoft 365 Audio Conferencing Microsoft 365 Domestic and International Calling Plan Microsoft 365 Domestic Calling Plan Microsoft 365 E5 Security Microsoft 365 Phone System Microsoft 365 Phone System Virtual User Power Apps per user plan Power Automate per user plan Power Automate per user with attended RPA plan
Current use <a href=”./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Engagement Plan.html” target=”_self" >10 <a href="./…/CAS/CAS-LicenseReport_Exchange Online Plan 1.html">21 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E3.html">41 <a href="./…/CAS/CAS-LicenseReport_Office 365 E3.html">0 <a href="./…/CAS/CAS-LicenseReport_Power BI Pro.html">7 <a href="./…/CAS/CAS-LicenseReport_Project Online Essentials.html">3 <a href="./…/CAS/CAS-LicenseReport_Project Online Professional.html">10 <a href="./…/CAS/CAS-LicenseReport_Project Online Premium.html">2 <a href="./…/CAS/CAS-LicenseReport_Visio Online Plan 2.html">12 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Service Professional.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Project Operations.html">2 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Sales Enterprise Edition.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 for Talent.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Team Members.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Activity.html">0 <a href="./…/CAS/CAS-LicenseReport_Enterprise Mobility Security E5.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Audio Conferencing.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic and International Calling Plan.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic Calling Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E5 Security.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System Virtual User.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Apps per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user with attended RPA plan.html">0
“,“type”:“rawHtml”,“id”:null,“refreshInterval”:0,“autoRefresh”:false,“hasCallback”:false}
15:02:07 [Debug] NewElementCommand {“tag”:“div”,“attributes”:{“className”:“left-align”},“events”:[],“content”:[{“markup”:“This is the overview of CAS current Office365 license usage on 11/19/2020 1:30 AM
<html xmlns=“http://www.w3.org/1999/xhtml”> TABLE{border-collapse:collapse;border-spacing:0;border-color:#aaa;}td{font-family:Arial, sans-serif;font-size:12px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;border-top-width:1px;border-bottom-width:1px;}th{font-family:Arial, sans-serif;font-size:12px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;border-top-width:1px;border-bottom-width:1px;}
CAS Dynamics 365 Customer Engagement Plan Exchange Online Plan 1 Microsoft 365 E3 Office 365 E3 Power BI Pro Project Online Essentials Project Online Professional Project Online Premium Visio Online Plan 2 Dynamics 365 Customer Service Professional Dynamics 365 Plan Dynamics 365 Project Operations Dynamics 365 Sales Enterprise Edition Dynamics 365 for Talent Dynamics 365 Team Members Dynamics 365 Unified Operations Plan Dynamics 365 Unified Operations Activity Enterprise Mobility Security E5 Microsoft 365 Audio Conferencing Microsoft 365 Domestic and International Calling Plan Microsoft 365 Domestic Calling Plan Microsoft 365 E5 Security Microsoft 365 Phone System Microsoft 365 Phone System Virtual User Power Apps per user plan Power Automate per user plan Power Automate per user with attended RPA plan
Current use <a href=”./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Engagement Plan.html” target="_self" >10 <a href="./…/CAS/CAS-LicenseReport_Exchange Online Plan 1.html">21 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E3.html">41 <a href="./…/CAS/CAS-LicenseReport_Office 365 E3.html">0 <a href="./…/CAS/CAS-LicenseReport_Power BI Pro.html">7 <a href="./…/CAS/CAS-LicenseReport_Project Online Essentials.html">3 <a href="./…/CAS/CAS-LicenseReport_Project Online Professional.html">10 <a href="./…/CAS/CAS-LicenseReport_Project Online Premium.html">2 <a href="./…/CAS/CAS-LicenseReport_Visio Online Plan 2.html">12 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Service Professional.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Project Operations.html">2 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Sales Enterprise Edition.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 for Talent.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Team Members.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Activity.html">0 <a href="./…/CAS/CAS-LicenseReport_Enterprise Mobility Security E5.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Audio Conferencing.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic and International Calling Plan.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic Calling Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E5 Security.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System Virtual User.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Apps per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user with attended RPA plan.html">0
“,“type”:“rawHtml”,“id”:null,“refreshInterval”:0,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“cafcce5a-a5ea-4a39-97b8-262de8dfa122”,“onMount”:null,“id”:“dade3ad5-ecb3-44ac-82a9-b9b9fd118d42”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}
15:02:07 [Debug] NewElementCommand {“tag”:“div”,“attributes”:{“className”:“card-content”},“events”:[],“content”:[{“tag”:“span”,“attributes”:{“className”:“card-title left-align “},“events”:[],“content”:[“blah blah”],“type”:“element”,“key”:“ed8d7792-a4c2-47e8-938d-87d505561dbf”,“onMount”:null,“id”:“3aa9734e-556d-409c-9508-6530e27e2d07”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false},{“tag”:“div”,“attributes”:{“className”:“left-align”},“events”:[],“content”:[{“markup”:“This is the overview of CAS current Office365 license usage on 11/19/2020 1:30 AM
<html xmlns=“http://www.w3.org/1999/xhtml”> TABLE{border-collapse:collapse;border-spacing:0;border-color:#aaa;}td{font-family:Arial, sans-serif;font-size:12px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;border-top-width:1px;border-bottom-width:1px;}th{font-family:Arial, sans-serif;font-size:12px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;border-top-width:1px;border-bottom-width:1px;}
CAS Dynamics 365 Customer Engagement Plan Exchange Online Plan 1 Microsoft 365 E3 Office 365 E3 Power BI Pro Project Online Essentials Project Online Professional Project Online Premium Visio Online Plan 2 Dynamics 365 Customer Service Professional Dynamics 365 Plan Dynamics 365 Project Operations Dynamics 365 Sales Enterprise Edition Dynamics 365 for Talent Dynamics 365 Team Members Dynamics 365 Unified Operations Plan Dynamics 365 Unified Operations Activity Enterprise Mobility Security E5 Microsoft 365 Audio Conferencing Microsoft 365 Domestic and International Calling Plan Microsoft 365 Domestic Calling Plan Microsoft 365 E5 Security Microsoft 365 Phone System Microsoft 365 Phone System Virtual User Power Apps per user plan Power Automate per user plan Power Automate per user with attended RPA plan
Current use <a href=”./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Engagement Plan.html” target=”_self” >10 <a href="./…/CAS/CAS-LicenseReport_Exchange Online Plan 1.html">21 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E3.html">41 <a href="./…/CAS/CAS-LicenseReport_Office 365 E3.html">0 <a href="./…/CAS/CAS-LicenseReport_Power BI Pro.html">7 <a href="./…/CAS/CAS-LicenseReport_Project Online Essentials.html">3 <a href="./…/CAS/CAS-LicenseReport_Project Online Professional.html">10 <a href="./…/CAS/CAS-LicenseReport_Project Online Premium.html">2 <a href="./…/CAS/CAS-LicenseReport_Visio Online Plan 2.html">12 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Service Professional.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Project Operations.html">2 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Sales Enterprise Edition.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 for Talent.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Team Members.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Activity.html">0 <a href="./…/CAS/CAS-LicenseReport_Enterprise Mobility Security E5.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Audio Conferencing.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic and International Calling Plan.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic Calling Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E5 Security.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System Virtual User.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Apps per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user with attended RPA plan.html">0
“,“type”:“rawHtml”,“id”:null,“refreshInterval”:0,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“9a15180e-c26e-479a-a969-4a5620ec57f4”,“onMount”:null,“id”:“dade3ad5-ecb3-44ac-82a9-b9b9fd118d42”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“62b66422-6399-4b44-9253-1f8bfa706860”,“onMount”:null,“id”:“86da8c62-146c-4505-987b-cdbd4a8eaadc”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}
15:02:07 [Debug] NewElementCommand {“tag”:“div”,“attributes”:{“style”:{“backgroundColor”:null,“color”:null},“className”:“card ud-card”},“events”:[],“content”:[{“tag”:“div”,“attributes”:{“className”:“card-content”},“events”:[],“content”:[{“tag”:“span”,“attributes”:{“className”:“card-title left-align “},“events”:[],“content”:[“blah blah”],“type”:“element”,“key”:“7624009f-8125-44fa-a593-8bbaad27f954”,“onMount”:null,“id”:“3aa9734e-556d-409c-9508-6530e27e2d07”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false},{“tag”:“div”,“attributes”:{“className”:“left-align”},“events”:[],“content”:[{“markup”:“This is the overview of CAS current Office365 license usage on 11/19/2020 1:30 AM
<html xmlns=“http://www.w3.org/1999/xhtml”> TABLE{border-collapse:collapse;border-spacing:0;border-color:#aaa;}td{font-family:Arial, sans-serif;font-size:12px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;border-top-width:1px;border-bottom-width:1px;}th{font-family:Arial, sans-serif;font-size:12px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;border-top-width:1px;border-bottom-width:1px;}
CAS Dynamics 365 Customer Engagement Plan Exchange Online Plan 1 Microsoft 365 E3 Office 365 E3 Power BI Pro Project Online Essentials Project Online Professional Project Online Premium Visio Online Plan 2 Dynamics 365 Customer Service Professional Dynamics 365 Plan Dynamics 365 Project Operations Dynamics 365 Sales Enterprise Edition Dynamics 365 for Talent Dynamics 365 Team Members Dynamics 365 Unified Operations Plan Dynamics 365 Unified Operations Activity Enterprise Mobility Security E5 Microsoft 365 Audio Conferencing Microsoft 365 Domestic and International Calling Plan Microsoft 365 Domestic Calling Plan Microsoft 365 E5 Security Microsoft 365 Phone System Microsoft 365 Phone System Virtual User Power Apps per user plan Power Automate per user plan Power Automate per user with attended RPA plan
Current use <a href=”./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Engagement Plan.html” target=”_self” >10 <a href="./…/CAS/CAS-LicenseReport_Exchange Online Plan 1.html">21 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E3.html">41 <a href="./…/CAS/CAS-LicenseReport_Office 365 E3.html">0 <a href="./…/CAS/CAS-LicenseReport_Power BI Pro.html">7 <a href="./…/CAS/CAS-LicenseReport_Project Online Essentials.html">3 <a href="./…/CAS/CAS-LicenseReport_Project Online Professional.html">10 <a href="./…/CAS/CAS-LicenseReport_Project Online Premium.html">2 <a href="./…/CAS/CAS-LicenseReport_Visio Online Plan 2.html">12 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Service Professional.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Project Operations.html">2 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Sales Enterprise Edition.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 for Talent.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Team Members.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Activity.html">0 <a href="./…/CAS/CAS-LicenseReport_Enterprise Mobility Security E5.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Audio Conferencing.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic and International Calling Plan.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic Calling Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E5 Security.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System Virtual User.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Apps per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user with attended RPA plan.html">0
“,“type”:“rawHtml”,“id”:null,“refreshInterval”:0,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“97b775ea-813c-40cc-8cc1-82ca728875d1”,“onMount”:null,“id”:“dade3ad5-ecb3-44ac-82a9-b9b9fd118d42”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“99c9636c-ff0d-46ee-a14f-0fff9888722e”,“onMount”:null,“id”:“86da8c62-146c-4505-987b-cdbd4a8eaadc”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“ebd56f2d-883a-41a8-82f7-da2fbca87533”,“onMount”:null,“id”:“61faf5da-a59e-4e45-abc5-c7cc0d70a8ca”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}
15:02:07 [Debug] ComponentController ConvertToActionResult() [{“tag”:“div”,“attributes”:{“style”:{“backgroundColor”:null,“color”:null},“className”:“card ud-card”},“events”:[],“content”:[{“tag”:“div”,“attributes”:{“className”:“card-content”},“events”:[],“content”:[{“tag”:“span”,“attributes”:{“className”:“card-title left-align “},“events”:[],“content”:[“blah blah”],“type”:“element”,“key”:“d0295814-0ae6-4bcc-b9d7-bae8d6c0bba2”,“onMount”:null,“id”:“3aa9734e-556d-409c-9508-6530e27e2d07”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false},{“tag”:“div”,“attributes”:{“className”:“left-align”},“events”:[],“content”:[{“markup”:“This is the overview of CAS current Office365 license usage on 11/19/2020 1:30 AM
<html xmlns=“http://www.w3.org/1999/xhtml”> TABLE{border-collapse:collapse;border-spacing:0;border-color:#aaa;}td{font-family:Arial, sans-serif;font-size:12px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;border-top-width:1px;border-bottom-width:1px;}th{font-family:Arial, sans-serif;font-size:12px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;border-top-width:1px;border-bottom-width:1px;}
CAS Dynamics 365 Customer Engagement Plan Exchange Online Plan 1 Microsoft 365 E3 Office 365 E3 Power BI Pro Project Online Essentials Project Online Professional Project Online Premium Visio Online Plan 2 Dynamics 365 Customer Service Professional Dynamics 365 Plan Dynamics 365 Project Operations Dynamics 365 Sales Enterprise Edition Dynamics 365 for Talent Dynamics 365 Team Members Dynamics 365 Unified Operations Plan Dynamics 365 Unified Operations Activity Enterprise Mobility Security E5 Microsoft 365 Audio Conferencing Microsoft 365 Domestic and International Calling Plan Microsoft 365 Domestic Calling Plan Microsoft 365 E5 Security Microsoft 365 Phone System Microsoft 365 Phone System Virtual User Power Apps per user plan Power Automate per user plan Power Automate per user with attended RPA plan
Current use <a href=”./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Engagement Plan.html” target=”_self” >10 <a href="./…/CAS/CAS-LicenseReport_Exchange Online Plan 1.html">21 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E3.html">41 <a href="./…/CAS/CAS-LicenseReport_Office 365 E3.html">0 <a href="./…/CAS/CAS-LicenseReport_Power BI Pro.html">7 <a href="./…/CAS/CAS-LicenseReport_Project Online Essentials.html">3 <a href="./…/CAS/CAS-LicenseReport_Project Online Professional.html">10 <a href="./…/CAS/CAS-LicenseReport_Project Online Premium.html">2 <a href="./…/CAS/CAS-LicenseReport_Visio Online Plan 2.html">12 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Customer Service Professional.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Project Operations.html">2 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Sales Enterprise Edition.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 for Talent.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Team Members.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Dynamics 365 Unified Operations Activity.html">0 <a href="./…/CAS/CAS-LicenseReport_Enterprise Mobility Security E5.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Audio Conferencing.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic and International Calling Plan.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Domestic Calling Plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 E5 Security.html">0 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System.html">4 <a href="./…/CAS/CAS-LicenseReport_Microsoft 365 Phone System Virtual User.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Apps per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user plan.html">0 <a href="./…/CAS/CAS-LicenseReport_Power Automate per user with attended RPA plan.html">0
",“type”:“rawHtml”,“id”:null,“refreshInterval”:0,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“e125e945-2a84-4326-bfdc-ba3dc2a532fb”,“onMount”:null,“id”:“dade3ad5-ecb3-44ac-82a9-b9b9fd118d42”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“5e8d8d58-e2af-40ca-9875-a9770df20065”,“onMount”:null,“id”:“86da8c62-146c-4505-987b-cdbd4a8eaadc”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}],“type”:“element”,“key”:“c555b51b-6dbe-48db-ac86-0ef2b1d24b45”,“onMount”:null,“id”:“61faf5da-a59e-4e45-abc5-c7cc0d70a8ca”,“refreshInterval”:5,“autoRefresh”:false,“hasCallback”:false}]
15:02:07 [Info] Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker Executed action method UniversalDashboard.Controllers.ComponentController.Input (UniversalDashboard), returned result Microsoft.AspNetCore.Mvc.JsonResult in 606.9935ms.
15:02:07 [Info] Microsoft.AspNetCore.Mvc.Formatters.Json.Internal.JsonResultExecutor Executing JsonResult, writing value of type ‘System.Object[]’.
15:02:07 [Info] Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker Executed action UniversalDashboard.Controllers.ComponentController.Input (UniversalDashboard) in 641.8137ms
15:02:07 [Info] Microsoft.AspNetCore.Hosting.Internal.WebHost Request finished in 671.1284ms 200 application/json; charset=utf-8

No offense man…but thats too much code for me to read through…Can you not simply put a hyperlink to the exisiting HTML document, and just launch it in a new window? Or what do you get if you output

to a text file? I personally would do something like that to make sure the variable is holding the information in the format you expect it. If it doesn’t look back on the code which populates that variable…is it in an endpoint, so can be shared with other endpoints?

Hi, no offence taken, your offering to help is much appreciated, I have put together a much reduced test dashboard - 2x pages - simple html code taken from examples on this site, both pages should display the same html document, page 1 works as expected, page 2 using the -endpoint does not.

I have outputted the contents of variable with the HTML to a text file and that all looks pretty clean - contents as expected.

<#
Script: UD-Port10033-OpenHTMLOnClient0.ps1

HTML Test Dashboard on Port 10033

#>

$PSScriptRoot = $MyInvocation.MyCommand.ScriptBlock.File #Full Script Path/Name
if (!$Script:PSScriptRoot)
{
if ($psISE)
{
$PSScriptRoot = Split-Path -Parent -Path $psISE.CurrentFile.FullPath
}
}

$MyLogFile = ‘C:\Temp\UD-Port10033-LogFile.txt’
$MyUDLogFile = ‘C:\Temp\UD-Port10033-UDLogging.txt’

Import-Module UniversalDashboard.Community

##---------------------------------------------------------------------------------
##Dashboard Details
$DashboardPort = ‘10033’
$DashboardName = ‘UDDashboard-’ + $DashboardPort
$DashboardTitle = ‘HTML Test’

Get-UDDashboard -Name $DashboardName | Stop-UDDashboard

Enable-UDLogging -Level Debug -FilePath $MyUDLogFile -Verbose #-Console

#------------------------------------------------------

HTML code example(s) - Plagiarised from Universal Dashboard WWW site

Either will show the issue, just make sure the one of interest is this the last to be named ‘$global:HTMLFileContent1’

$global:HTMLFileContent1 =
"BODY{font-family: Calibri; font-size: 10pt;}TABLE{border: 1px solid black; border-collapse: collapse;}TH{border: 1px solid black;color: #FFFFFF; background: #1C6EA4; padding: 5px; }TD{border: 1px solid black; padding: 5px; }





Deployment Name Collection Name Available Time Deployment Deadline Suppress Reboot Override Maint. Window Reboot Override Maint. Window Install
Restart-Deployment Collection5 4/9/2019 5:00:00 PM 4/9/2019 9:00:00 PM Server & Workstation No No
No Restart Deployment Collection6 4/9/2019 5:00:00 PM 4/9/2019 9:00:00 PM None No No
"

$global:HTMLFileContent1 =
"



Hello World



"

#------------------------------------------------------
##This one works as expected… -HTML is displayed
$DashboardPage1 = New-UDPage -Name “Example-1” -Icon Link -Content {
##Output HTML to Text file for testing purposes
$global:HTMLFileContent1 | Out-File C:\Temp\UD-Port10033-Page1-OutputHTML.txt
New-UDHtml -Markup $global:HTMLFileContent1
}

#------------------------------------------------------
##This one does NOT work as expected… -HTML is NOT displayed
$DashboardPage2 = New-UDPage -Name “Example-2” -Icon Link -Content {
New-UDRow -Columns {
New-UDColumn -size 5 -Content {
New-UDCard -BackgroundColor “#8789c0” -Title “Example-2” -Content {
New-UDInput -Title "Business Unit " -Id ‘BUSelect’ -Content {
New-UDInputField -Type ‘select’ -Name ‘BUSelect’ -PlaceHolder ‘Select Business Unit’ -Values @(“BU1”,“BU2”)
} -Endpoint {
##Selection made…now display the HTML content!!
Show-UDToast -Message “You have Selected: $BUSelect” -Duration 2000 -Position topLeft -BackgroundColor red -MessageColor white
##Output HTML to Text file for testing purposes
$global:HTMLFileContent1 | Out-File ‘C:\Temp\UD-Port10033-Page2-OutputHTML.txt’
New-UDHtml -Markup $global:HTMLFileContent1
}
}
}
}
}

#------------------------------------------------------
##Build the final dashboard
$DashboardBuild = New-UDDashboard -Title $DashboardTitle -Pages @($DashboardPage1, $DashboardPage2)

Start-UDDashboard -Port $DashboardPort -Dashboard $DashboardBuild -Name $DashboardName

Start-Process http://localhost:$DashboardPort

Dude, just what I do whether it is right or wrong…but why don’t you just set the endpoint on the New-UDColumn and the set the refresh on it…this will make everything inside the column dynamic :slight_smile: I have used this many a time when the other endpoint I was setting did not work…

New-UDColumn -Size 5  -Endpoint {
##put code in here using content stuff that works in script one....
} -AutoRefresh -RefreshInterval 5