Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Process flow visibility based on conditions of a field value

Release: Australia
Sriram34
Tera Contributor

Hello Team,

 

I have a requirement to hide certain stages in process flow.

 

For example:

 

Sriram34_0-1796316064564.png

 

There is a field called 'type'.

 

If type is software only draft, scoping, Testing Qa, Closed stages should be visible on the form.

if type is hardware then only Draft, Awaiting approval, Testing, Deployment stages should be visible on form.

 

How to implement this.

 

Currently we used process flow to build it.

 

2 REPLIES 2

yashkamde
Tera Sage

Hello @Sriram34 ,

 

Refer this :

How to Hide Process flow based on condition 

 

If my response helped mark as helpful and accept the solution.

Aditya_hublikar
Giga Sage

Hello @Sriram34 ,

 

I tried your usecase on my pdi , so it requires onload client script to hide and show ;

function onLoad() {
    var isFlagTrue = g_form.getValue('u_inc_flag');

    function hideStage(label) {
        $j("li a, ol.process_flow li, ul.process_flow li").filter(function() {
            return $j(this).text().trim() === label;
        }).closest("li").remove();
    }

    setTimeout(function() {
        if (isFlagTrue === 'true') {
            // Hide Hardware-only stages (keeps Draft, Scoping, Testing Qa, Closed)
            hideStage('Awaiting approval');
            hideStage('Testing');
            hideStage('Deployment');
        } else if (isFlagTrue === 'false') {
            // Hide Software-only stages (keeps Draft, Awaiting approval, Testing, Deployment)
            hideStage('Scoping');
            hideStage('Testing Qa');
            hideStage('Closed');
        }

      
        var $flowList = $j("ol.process_flow, ul.process_flow, .process-flow-container");
        $flowList.css({
            "overflow-x": "hidden",
            "width": "100%"
        });
        $flowList.parent().css("overflow-x", "hidden");
    }, 300);
}

Aditya_hublikar_0-1796319097411.png

 Here i hide and show on basis of inc flag field .

Aditya_hublikar_1-1796319194117.pngAditya_hublikar_2-1796319224976.png

 

 

If this helps you then mark it as helpful and accept as solution .

Regards,
Aditya