Show/Hide state field choices on the form

aarthi Mohanraj
Tera Contributor

Hello,

I have a state flow on the form with state 'Open','WIP','review','closed'..

Also i have a state field on the form which have choices 'open','wip','review','closed complete','closed incomplete','closed skipped'..

I need to hide the choices'closed complete','closed incomplete','closed skipped', when the state flow is in 'open' OR 'WIP'

Also I need to show the choices 'closed complete','closed incomplete','closed skipped' only when the state flow is in 'review'.

How do i Acheieve this..Please suggest the best approach and share any sample script

3 REPLIES 3

Abbas_5
Tera Sage
Tera Sage

Hello @aarthi Mohanraj,

You can try with 2 UI policies:
Condition: When the state is one of open or WIP
Ui policy actions:
Closed completed makes it visible as false

Closed incomplete makes it visible as false

Closed skipped makes it visible as false

Condition: When the state is review

Ui policy actions:
Closed completed makes it visible as true

Closed incomplete makes it visible as true

Closed skipped makes it visible as true

 

Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik

Hello Abbas,

Thanks for your solution. But we can able to add only the field name'state' in UI actions, not the state choices 'Closed completed ','Closed incomplete '..As suggested added the condition Condition: When the state is one of open or WIP and added script below..Its working

g_form.removeOption('state',' choice value');
g_form.removeOption('state','choice value');
g_form.removeOption('state','choice value');

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @aarthi Mohanraj ,

 

you can simply create a UI Policy for this as suggested by @Abbas_5  above... That must help...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect