You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-11-15 14:53:36

WebGreg
Member
Registered: 2020-02-27
Posts: 729

FormCreator - condition work selectively

Hello.

I set condition for "Show submit button" as
"Hidden unless" QUESTION1  >  {empty field - I just didn't enter anything in this field}

Works, but for the Text type. If I change it to Textarea - it doesn't work.


Likewise when I set for the question2 (dropdown > locations) condition:
"Hidden unless" QUESTION1  >  {empty field} - doesn't work.



Or maybe this is correct behavior and I should set the condition "if not empty" in a different way?


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#2 2021-11-15 14:55:21

btry
Moderator
Registered: 2015-10-01
Posts: 593

Re: FormCreator - condition work selectively

Hi

Which version of Formcreator ?


No support with MP - Always run an upgrade task on a testing instance before running it on production! Always backup before any upgrade task!

Offline

#3 2021-11-15 15:03:34

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Re: FormCreator - condition work selectively

2.12.3 with GLPI 9.5.6



JSON:

{"schema_version":2.12,"forms":[{"name":"test2","is_recursive":0,"icon":"fas fa-dharmachakra","icon_color":"#fc0303","background_color":"#e7e7e7","access_rights":1,"description":"","content":"","is_active":1,"language":"en_GB","helpdesk_home":1,"is_deleted":0,"validation_required":0,"is_default":0,"is_captcha_enabled":0,"show_rule":2,"uuid":"d99feb60-8d9ac576-61926b4f0d9ac6.30348825","_entity":"Root entity","_plugin_formcreator_category":"","_profiles":[],"_sections":[{"name":"Category1","order":-2,"show_rule":1,"uuid":"d99feb60-8d9ac576-619265f9574893.71038880","_questions":[{"name":"Question1","fieldtype":"select","required":1,"show_empty":1,"default_values":0,"values":"[\"Answer1\",\"Answer2\",\"Answer3 (test test).\"]","description":"","row":0,"col":0,"width":4,"show_rule":1,"uuid":"d99feb60-8d9ac576-619264fca60466.88614644","_conditions":[],"_parameters":[]}],"_conditions":[]},{"name":"Category2","order":-1,"show_rule":2,"uuid":"d99feb60-8d9ac576-619265f9570f45.68301694","_questions":[{"name":"Question2","fieldtype":"checkboxes","required":1,"show_empty":0,"default_values":"[]","values":"[\"answer1\",\"answer2\",\"answer3\"]","description":"","row":0,"col":0,"width":4,"show_rule":1,"uuid":"d99feb60-8d9ac576-619264fcadd5f2.81117925","_conditions":[],"_parameters":{"checkboxes":{"range":{"range_min":"","range_max":"","fieldname":"range","uuid":"d99feb60-8d9ac576-619264fcb23015.41357102"}}}},{"name":"Question3 (dropdown)","fieldtype":"dropdown","required":1,"show_empty":1,"default_values":0,"values":"{\"itemtype\":\"Location\",\"show_tree_depth\":\"1\",\"show_tree_root\":\"0\",\"selectable_tree_root\":\"0\",\"entity_restrict\":\"3\"}","description":"<p>test</p>","row":1,"col":0,"width":4,"show_rule":2,"uuid":"d99feb60-8d9ac576-619264fcb84ff7.12650253","_conditions":[{"itemtype":"PluginFormcreatorQuestion","plugin_formcreator_questions_id":"d99feb60-8d9ac576-619264fcadd5f2.81117925","show_condition":4,"show_value":"","show_logic":1,"order":1,"uuid":"d99feb60-8d9ac576-61926b4d6b4de4.08106744"}],"_parameters":[]}],"_conditions":[{"itemtype":"PluginFormcreatorSection","plugin_formcreator_questions_id":"d99feb60-8d9ac576-619264fca60466.88614644","show_condition":1,"show_value":"Answer3 (test test).","show_logic":1,"order":1,"uuid":"d99feb60-8d9ac576-61926759b3b145.37409407"}]}],"_conditions":[{"itemtype":"PluginFormcreatorForm","plugin_formcreator_questions_id":"d99feb60-8d9ac576-619264fcb84ff7.12650253","show_condition":4,"show_value":"","show_logic":1,"order":1,"uuid":"d99feb60-8d9ac576-61926b4f20e704.45075789"}],"_targets":{"PluginFormcreatorTargetTicket":[],"PluginFormcreatorTargetChange":[]},"_validators":[],"_translations":[]}]}



After disabling the condition for the "submit button" visibility, the Question3 it displays correctly after selecting one of the answers to Question 2.

Last edited by WebGreg (2021-11-15 16:26:20)


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#4 2021-11-15 18:11:12

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Re: FormCreator - condition work selectively

I am still testing and... If I add Question4 with the condition:

"Hidden unless" QUESTION3  >  {empty field}

It stops working - the send button disappears, and only Question2 is displayed.


1. Did not work
Question2 - always displayed
Question3 - hidden unless (> question2)
Question4 - hidden unless (> question3)

2. It works
Question2 - always displayed
Question3 - hidden unless (> question2)
Question4 - hidden unless (> question2)

3. It works
Question2 - hidden unless (> question1)
Question3 - hidden unless (> question2)
Question4 - hidden unless (> question2)

4. Did not work
Question2 - hidden unless (> question1)
Question3 - hidden unless (> question2)
Question4 - hidden unless (> question3)

Question1 - 1st section; Question2-4 - 2nd section.

Last edited by WebGreg (2021-11-15 18:16:19)


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

Board footer

Powered by FluxBB