Skip to main content
12-Amethyst
May 9, 2024
Solved

How to use Functions to enable visibility of a widget

  • May 9, 2024
  • 1 reply
  • 891 views

Hi,

Does anyone know how to set up a function perhaps an expression to send the "true" boolean to the Visible property of a widget or container in a mashup?

My mashup displays a grid with data and with a button below the grid to allow the user to export/download a CSV of the data displayed. I would like this button to become visible only when the data has finished loading in the grid. 

 

TIA

Best answer by Velkumar

Hi @mariaSutton 

 

Create an expression which always sends Output as True

Output = true

Disable Auto Evaluate and Change Date Change Type to Always

Velkumar_0-1715310456929.png

Whenever grid data service completed, you evaluate the expression 

Velkumar_1-1715310613948.png

 

And map expression output to Button Visibility.

 

There is one more suggestion instead using expression you can use custom service to validate infotable data. 

 

You can create custom service to validate infotable data size

let datalength = infotableinput.length;
let result = datalength > 0 ? true : false; // To set button visibility

And map service output to button visibility.

 

In this approach, button will be invisible if there are no data returns from the service

 

/VR

1 reply

Velkumar19-TanzaniteAnswer
19-Tanzanite
May 10, 2024

Hi @mariaSutton 

 

Create an expression which always sends Output as True

Output = true

Disable Auto Evaluate and Change Date Change Type to Always

Velkumar_0-1715310456929.png

Whenever grid data service completed, you evaluate the expression 

Velkumar_1-1715310613948.png

 

And map expression output to Button Visibility.

 

There is one more suggestion instead using expression you can use custom service to validate infotable data. 

 

You can create custom service to validate infotable data size

let datalength = infotableinput.length;
let result = datalength > 0 ? true : false; // To set button visibility

And map service output to button visibility.

 

In this approach, button will be invisible if there are no data returns from the service

 

/VR