cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to use Functions to enable visibility of a widget

mariaSutton
8-Gravel

How to use Functions to enable visibility of a widget

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

1 REPLY 1

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

Top Tags