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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to use Functions to enable visibility of a widget

mariaSutton
12-Amethyst

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

ACCEPTED SOLUTION

Accepted Solutions
Velkumar
19-Tanzanite
(To:mariaSutton)

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
Velkumar
19-Tanzanite
(To:mariaSutton)

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

Announcements


Top Tags