- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 06:35 AM
I have a UI ACTION button that I want to Hide. I am getting an answer from Script-Include of TRUE/FALSE which is stored in 'response' Variable.
But for some reason the script enters the first if conditions (gets to the if with 'entered Show command' InfoMessage and the show() command) regardless of the value I get in response. does anyone have a clue on why this is happening or how to fix it?
 
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 06:38 AM
maybe it's getting passed as a string and not a Boolean.
Try
if (response == 'true'){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 06:38 AM
maybe it's getting passed as a string and not a Boolean.
Try
if (response == 'true'){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 06:43 AM
Thanks you saved the day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 06:45 AM - edited ‎12-07-2022 06:48 AM
Try replacing lines 7,8,9 with this:
function getResponse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer) {
The reason your code isn't working is as follows:
Here "response" is an XML document which contains an attribute "answer" and the value returned from the function bound with the answer attribute.
So response.responseXML.documentElement.getAttribute("answer") gives us the value returned from the script includes function.
Please mark as Helpful/Correct if this helps solve your issue
Regards
Paul