What widget are you using as an image output?
Here is some more information on the Expression widget (requires support login): https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS233996&lang=en_US
and the Validator widget https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS250781&lang=en_US
Please try this link, validator widget would be a perfect solution for you: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS250781&lang=en_US
- The Validator Widget is an invisible widget that is used to perform operations on data currently entered in the Mashup
- The Validator Widget is a simple version of the Expression widget as its OutputBaseType is set to Boolean
- For detailed description of Expression widget, please refer to CS233996
- The Validator Widget has True and False Events and can be used to trigger other services, which is easier to use than the Data Changed event in Expression widget
- Define parameters / input bind points
- When using the Validator widget, there needs to be a way to bring in the data from external fields / services / etc.
- Select the Validator Widget and click the Configure Validator button (gear icon) in the top right corner of the Widget Properties pane to bring up the Configure Widget dialog.
- Use the Add Parameter button to create all necessary parameters to the widget.
- Each parameter requires a name, which can be used in your expression.
- BaseType specifies the allowed data type that can be bound to the parameter.
- After defining all parameters and clicking the Done button, the new parameters appear as bind points in the properties list for the Widget.
- Define the expression
- For simple comparison expressions, the if() else() would not be needed
- If the input is Boolean type, "input" can be put directly in the expression field
- If the input is numeric type, "input ==1" can be put directly in the expression field
- Evaluate the expression
- The Expression widget is triggered by the Evaluate widget event.
- There is a AutoEvaluate checkbox, and the evaluate the expression when input is changed
- This event can be bound to a button widget's Clicked event, or as part of an input field widget's Changed event.
- Returning result
- The result of Validator widget is a Boolean type, it can be used to disable or control the visibility of other widgets
- The True and False event can be used to trigger other services or events like Navigate, Execute or Refresh