[Ch...] Posted May 15, 2023 Share Posted May 15, 2023 Hi, i have created a "dynamic" Dialog wich has as many lines and checkboxes in it as the report has keyworks. Now i'm trying to get to the results. Is there a way to get all avalable results from a dialog instead of access them directly? Link to comment Share on other sites More sharing options...
[Ch...] Posted May 16, 2023 Author Share Posted May 16, 2023 i can get this from the "result" object: gom.dialog.DialogResult ('checkbox0': False, 'checkbox1': False, 'checkbox2': False, 'checkbox3': False) would it be possible to iterate over the results? Link to comment Share on other sites More sharing options...
[Na...] Posted May 16, 2023 Share Posted May 16, 2023 Hello Christoph, does this FAQ regarding Dialogs help you? Scripting - User-Defined Dialogs - GOM FAQ - GOM Connect Nanno Link to comment Share on other sites More sharing options...
[Ma...] Posted June 16, 2023 Share Posted June 16, 2023 Please have a look at the attached solution. The trick is to convert the returned object into a string and then parse it into an array and (if needed) into a dictionary. Please note that the values inside the dictionary are still strings, but converting to the desired types (boolean, integer, float) should be easy. Example output from a dialog with 4 checkboxes: RESULT (string) gom.dialog.DialogResult ('checkbox_0': True, 'checkbox_1': False, 'checkbox_2': True, 'checkbox_3': False) 'checkbox_0': True, 'checkbox_1': False, 'checkbox_2': True, 'checkbox_3': False key: checkbox_0 val: True key: checkbox_1 val: False key: checkbox_2 val: True key: checkbox_3 val: False RESULT (dictionary) {'checkbox_0': 'True', 'checkbox_1': 'False', 'checkbox_2': 'True', 'checkbox_3': 'False'} checkbox_0 True checkbox_1 False checkbox_2 True checkbox_3 False dialog_results.py Link to comment Share on other sites More sharing options...
[Ti...] Posted June 16, 2023 Share Posted June 16, 2023 (edited) Hi Christoph, There is a simple solution. You can just use: Code: RESULT.__args__[0] Output: {'checkbox': False, 'date': gom.Date (16, 6, 2023), 'elementname': '', 'input': 0.0} Edited June 16, 2023 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in