Is there a way to pass a parameter to the page when you call it?
Also, I'm using the input field and New-UDInputAction -Content to show my Dashboard. The input field takes a computer name and the dashboard show the cpu activity for that computer. The issue is that in order to show again the input field I have to refresh the page. Is there another way to do it?
I think dynamic pages is what you are looking for, I am looking into this right now and not having any luck. From his documentation it should be fairly simple, yet when I do it i just get a black page. Here I have my homepage with just the user input field, then when they put in the pc name and submit, the dynamic page should show up with the user input field at the top and then a card with the pcname. This is just a simple page to test the functionality, but all I get is a blank page.
Yes I got it to work, using it for a portal for our service desk to get PC info/stats of the users pc via computername. Im on vacation till till monday and can share the code with ya.
Dynamic pages are exactly what I was looking for. I think I'm running into the same problem you were originally though.
After inputting computer name I am being brought to a blank page. How do you call on the script you've stored in $Dynamic? From what I can tell your script is just starting up a new dashboard with the $HOMEPAGE variable, then redirecting that to the "/dynamic/$Computer" URL but none of the queries are being called on from within the $Dynamic variable.
That got it goin! What a simple fix. I did end up getting it to work as well but I took a different approach. Instead of calling on two variables I used one and first built the page for user input, then once the input was received I built the second page and redirected to it. In the end probably the same results and same speed.
Have you experimented with multiple parameters yet? In my environment we deal with multiple domains where we do not have a trust setup. To work around this we store credentials in secure strings, encrypt them and then call on them as needed for each domain. Being able to pass multiple variables into these pages would make it possible to work around this limitation in my use case.
Awesome, glad you got it working! I havent had the need to do multiple variables, but I would assume its possible, or on your user input fields have one for each domain with a static domain variable so if a user uses domain1 for input the dynamic page would go to the dynamic page for domain1 and the same for domain2, it would go to the dynamic page you built for domain2.
1
u/Gotcha007 Nov 10 '17
2 Questions.
Is there a way to pass a parameter to the page when you call it?
Also, I'm using the input field and New-UDInputAction -Content to show my Dashboard. The input field takes a computer name and the dashboard show the cpu activity for that computer. The issue is that in order to show again the input field I have to refresh the page. Is there another way to do it?