Pergapedia / SSP7
SMTX SupportSMTX Wiki
  • Introduction
  • Pergapedia / SSP7 Admin guide
  • Catalog
    • Typical use cases
      • Usage as Knowledge Catalog
      • Usage as Data Catalog
      • Usage as Service Catalog
    • Catalog Maintenance
      • Templates
        • Create a new template
        • Version management of templates
        • ACL (Access Control Lists)
          • Scopes
          • Add default ACLs
          • Remove All ACLS
          • ACL condition script examples
        • Set translation label for Publication request button
      • Parts (Fields)
        • Field types
        • Calculations
        • Field Validation examples
        • Field Visibility Examples
        • Field Filtering
        • Default value
      • Actors
      • Reusable content
      • Settings
      • General Settings
      • Roles
      • Javascript for Variables in processes
      • Action Forms
        • Add log entries for Action Forms
    • Service Maintenance
      • Services
        • Filter list of services
        • Duplicating services
        • Adding a new service
        • Service Details
          • General settings
          • Service Data
          • Contracts
          • Actors
          • Receivers
          • Targets
          • Support Groups
          • Relations
          • Requests
          • Quality Notes
          • Publication History
          • Documents
          • Log
          • Service Actions
        • Compare versions
        • Quality Notes
        • Service Changed flag
      • Approvals
      • Relations
        • Start service from service
      • Subscriptions
      • Outages
    • Public
    • Service Catalog API
      • Outbound REST API
        • Get Services
        • Get Service Details
      • Inbound SOAP calls
        • Create custom approval
        • Add log to service publish request
        • Add person to service person list
        • Add persongroup to service persongroup list
        • Delete service
        • Mark service publish request as in approval state
        • Process service publish request
        • Publish request set can be cancelled
        • Publish request set show in public
        • Remove person from service person list
        • Remove persongroup from service persongroup list
        • Remove support group from service
        • Update service field
        • Update service language field
        • Update template part datetime value
        • Update template part numeric value
        • Update template part text value
  • Fulfillment Platform
    • Admin Panel
    • General Settings
      • General
      • My Profile
      • Mail Settings
      • Login
      • Forms Setting
      • Workflow
      • Archive
      • Calendar Overview
      • Dashboard
      • Mobile Component
      • Ticketing
      • Webhooks
      • Goto
      • Search options
      • Application URL Settings
      • Address Book Settings
    • Dashboard
    • Categories
    • Topics
    • Forms
      • Fields-tab
      • Field: General Settings
      • Dynamic Value
      • Text (Area) Field
      • Yes : No Field
      • Upload file(s)
      • Date (Time) Field
      • Password Field
      • Read Only Display Field
      • Header
      • Tab
      • Section
      • Repeatable section buttons
      • Subform
      • Static HTML
      • Hidden Field
      • Selection Fields
      • Calculations
    • Processes
      • General Settings
      • Dynamic Field Mapping
      • Process Steps
      • Step Types
      • Logging
    • Datastore
      • Process interaction
      • Manage datastore entries via Webservices - Javascript
    • Tasks
    • Auto Forms
    • Adapters
      • Person Data
      • Web Services
    • Event triggers
    • Roles
    • Rolesets
    • Groups
    • Views
      • View Example 1
      • View example 2
    • Mail Templates
    • Layouts
    • Mail queue
    • Reporting
    • External Apps
    • My Items
    • Translations
    • Bulk Uploads
    • Help page
    • Goto
    • Search
    • Inbound Email
    • Reporting Dashboard
    • Ticketing
      • My Activities
      • Ticketing Views
      • External Integrations
    • Release Manager
    • Content Management Console module
    • SSP Studio
    • Persons & Accounts
    • Pools
  • Release Notes
    • Terms and Conditions
      • December 2024
    • Release 7.21.01
    • Release 7.21.03
    • Release 7.21.04
    • Release 7.21.05
    • Release 7.21.06
    • Release 7.21.07
    • Release 7.21.08
    • Release 7.21.09
    • Release 7.21.10
    • Release 7.21.11
    • Release 7.21.12
    • Release 7.22.02
    • Release 7.22.03
    • Release 7.22.04
    • Release 7.22.05
    • Release 7.22.06
    • Release 7.22.07
    • Release 7.22.08
    • Release 7.22.09
    • Release 7.22.10
    • Release 7.22.12
    • Release 7.23.01
    • Release 7.23.02
    • Release 7.23.03
    • Release 7.23.04
    • Release 7.23.05
    • Release 7.23.07
    • Release 7.23.08
    • Release 7.23.09
    • Release 7.23.10
    • Release 7.23.11
    • Release 7.23.12
    • Release 7.24.02
    • Release 7.24.03
    • Release 7.24.04
    • Release 7.24.05
    • Release 7.24.06
    • Release 7.24.07
    • Release 7.24.08
    • Release 7.24.09
    • Release 7.24.10
    • Release 7.24.11
    • Release 7.24.12
    • Release 7.25.01
    • Release 7.25.02
    • Release 7.25.03
    • Release 7.25.04
    • Release 7.25.05
  • Guides
    • Installation Guide
      • Scheduled Task installation
    • Upgrade Guide
    • LDAP Import
    • Training
      • Exercise : Create a new form
      • Exercise : Create a new Datastore Parameter
      • Exercise : Create a new Process
      • Exercise : Create a new Role
    • SubTopics in Topics
  • Pergapedia platform
Powered by GitBook
On this page
  • Where do you set it?
  • Possible conditions
  • Value = X
  • Value is different from X
  • Value equals to X, Y or Z
  • Value is TRUE (Yes) (only valid for Yes/No field)
  • Value is FALSE (No) (only valid for Yes/No field)
  • Combine AND & OR
  • Multiple AND conditions
  • If anything is picked in another field, show this field:
  • Chosen values form a multi-select contain X
  • Chosen values from a multi-select contain X or Y
  • Value (integer) is bigger than X
  • OR statement between 2 Yes/No fields:
  • If a number greater than 0 is entered in field A or in field B, display the third field:
  • Emptying values ​​from a fields
  • Phase = X
  • Show a field from phaseX

Was this helpful?

  1. Catalog
  2. Catalog Maintenance
  3. Parts (Fields)

Field Visibility Examples

You can set conditions on each field, so you can determine whether the field is shown or not.

PreviousField Validation examplesNextField Filtering

Last updated 1 year ago

Was this helpful?

Where do you set it?

Open a field:

Click on tab 'advanced'

This manual explains how to set the conditions via Javascript, so always choose this option in the dropdown.

A condition always depends on the chosen value(s) in another field. You can call up all fields via the last dropdown:

Please note, this list can be very long. The questions are grouped by tab, and then alphabetically.

Once you have chosen a field, this will appear:

Choose 'Value' each time to place the condition. The Values ​​are only numeric if necessary, so the label value can be freely adjusted.

Click ADD to add the reference in the 'Visibility' field.

It will say this: #REPLACE-PARTVALUE-aanvraag_type||Value#

Possible conditions

Value = X

return #REPLACE-PARTVALUE-<internal label>||Value#

=== 'X';

Example

return #REPLACE-PARTVALUE-aanvraag_type||Value#

=== '4';

Value is different from X

return #REPLACE-PARTVALUE-<internal label>||Value#

!== 'X';

Example return #REPLACE-PARTVALUE-aanvraag_type||Value#

!== '9';

Value equals to X, Y or Z

var <internal_label> = #REPLACE-PARTVALUE-<internal_label>||Value#;

if (<internal_label> == X || <internal_label> == Y || <internal_label> == Z) return true

else return false

Explanation So we first create a variable, and use it in the conditions.

'OR' conditions are put together via ||.

Example:

var aanvraag_type = #REPLACE-PARTVALUE-aanvraag_type||Value#;

if (aanvraag_type == 1 || aanvraag_type == 2 || aanvraag_type == 4) return true

else return false

Value is TRUE (Yes) (only valid for Yes/No field)

return #REPLACE-PARTVALUE-<internal_label>||# === "true"

Value is FALSE (No) (only valid for Yes/No field)

return #REPLACE-PARTVALUE-<internal_label>||# === "false"

Combine AND & OR

example:

([aanvraag_type]='4' or [aanvraag_type]='2') and [st_opdrg_int_yn]='1'

This is how it is built:

var <internal_label1> = #REPLACE-PARTVALUE-<internal_label1>||Value#;

var <internal_label2> = #REPLACE-PARTVALUE-<internal_label2>#;

if ((<internal_label1> == 2 || <internal_label1> == 4) && (<internal_label2> == true)) return true

else return false

Multiple AND conditions

We want to make this: [aanvraag_type]='4' and [aanvraag_chemsubst_yn]='1' and [st_opdrg_int_yn]='1'

var <internal_label1> = #REPLACE-PARTVALUE-<internal_label1>||Value#;

var <internal_label2> = #REPLACE-PARTVALUE-<internal_label2>#;

var <internal_label3> = #REPLACE-PARTVALUE-<internal_label3>#;

if ((<internal_label1> == 4) && (<internal_label2> == true) && (<internal_label3> == true )) return true

else return false

----Example (looking at 2 yes/no - fields)---

var MEDDEV_CE_markering_scope_YN = #REPLACE-PARTVALUE-MEDDEV_CE_markering_scope_YN||#;

var MEDDEV_andere_indicatie = #REPLACE-PARTVALUE-MEDDEV_andere_indicatie||#;

if ((MEDDEV_CE_markering_scope_YN == "true") && (MEDDEV_andere_indicatie == "true")) return true

else return false

If anything is picked in another field, show this field:

return (#REPLACE-PARTVALUE-<internal_label>||#)

In case of multiselect, it is better to use PLAIN TEXT as type, and just put the reference to the part in the 'Visibility' box.

Chosen values form a multi-select contain X

return #REPLACE-PARTVALUE-<internal_label>||#.indexOf('X') >= 0

So we count the number of times that 'X' (index) occurs

Chosen values from a multi-select contain X or Y

Example: if the field ‘Multiselect’ contains ‘Conferenties’ OR ‘Diverse personeelskosten’, then show the second field.

var Conferenties = #REPLACE-PARTVALUE-Multiselect||#.indexOf('Conferenties');

var Diverse = #REPLACE-PARTVALUE-Multiselect||#.indexOf('Diverse personeelskosten');

if ((Conferenties >= 0) || (Diverse >= 0)) return true

else return false

Value (integer) is bigger than X

return #REPLACE-PARTVALUE-<internal_label>||# && Number(#REPLACE-PARTVALUE-<internal_label>||#) > X

Note: the internal label is entered twice

OR statement between 2 Yes/No fields:

var <internal_label> = #REPLACE-PARTVALUE-<internal_label>||#;

var <internal_label2> = #REPLACE-PARTVALUE-<internal_label2>||#;

if ((<internal_label> == "true") || (<internal_label2> == "true")) return true

else return false

It can also be like this:

var <internal_label> = #REPLACE-PARTVALUE-<internal_label>||#;

var <internal_label2> = #REPLACE-PARTVALUE-<internal_label2>||#;

return ((<internal_label> == "true") || (<internal_label2> == "true"))

Example:

var schriftelijke_toestemming_YN = #REPLACE-PARTVALUE-schriftelijke_toestemming_YN||#;

var mondelinge_toestemming_YN = #REPLACE-PARTVALUE-mondelinge_toestemming_YN||#;

return ((schriftelijke_toestemming_YN == "false") || (mondelinge_toestemming_YN == "false"))

If a number greater than 0 is entered in field A or in field B, display the third field:

Field 1 = Inschatting_aantal_deelnemers_0_tot_12_jaar

Field 2 : Inschatting_aantal_deelnemers_12_tot_18_jaar

This is the JS, please note ‘||’ as OR statement

var a0tot12 = Number(#REPLACE-PARTVALUE-Inschatting_aantal_deelnemers_0_tot_12_jaar||#);

var a12tot18 = Number(#REPLACE-PARTVALUE-Inschatting_aantal_deelnemers_12_tot_18_jaar||#);

return a0tot12 > 0 || a12tot18 > 0;

NOTE: in Javascript variables cannot start with a number!

Emptying values ​​from a fields

UZgent would like to have the option to un-select radio buttons.

We have already discussed this, and it is indeed not obvious.

After a discussion with UZ Gent, it turned out that the problem is there, but that another issue lies at the root.

The visibility rules are not switched in the SC. I explain myself further:

Relations

Field B is dependent of field A.

Field C is dependent of field B.

Type of fields

Field A : yes/no

Field B: yes/no : is only visible when 'Yes' on field A

field C: tekst field : is only visible when 'Yes' on field B

Scenario

I choose 'yes' at fields A& B, field C comes up = correct.

However, I then change field A to 'No', and because of that field B disappears, but field C remains.

C remains because the value of B is still set to 'yes', but B is no longer visible.

So , the entered 'yes' at field B will also be stored in the DB, but should actually be emptied.

So, long story short, if a field is not visible, the chosen value should be cleared. This is also important for later reports.

Solution

Set default value to dropdown, which refers to the yes/no, but always returns an empty string:

var temp = #REPLACE-PARTVALUE-JaNee||#;

return "";

Same for the text field, there you can choose either to set the trigger to yes/no or to set it to the dropdown (triggers work recursively)

var temp = #REPLACE-PARTVALUE-DropDownNaYesNo||#;

return "";

Phase = X

We want to show a field when the Phase = PhaseX

This is how to do it:

return #REPLACE-SERVICE-PHASE||Name# === 'PhaseX';

Show a field from phaseX

Phases have a built in order, and that is what we are using in this JS:var = currentphaseorders

We first get the Order of the phase the service is currently in :

Next, we get the Order of the phase from which we want to show this field, in this case 'PhaseX': var = targetphaseorders

Finally, we compare both values. This is the JS example:

var currentphaseorders = JSON.parse(CommonInterface.callWebservice('Get Phase Order By Name', { 'Name': #REPLACE-SERVICE-PHASE||Name# }));

var targetphaseorders = JSON.parse(CommonInterface.callWebservice('Get Phase Order By Name', { 'Name': 'PhaseX' }));

return currentphaseorders.length > 0 && targetphaseorders.length > 0 && +currentphaseorders[0].ItemOrder >= +targetphaseorders[0].ItemOrder;