How to set data in table by scripting

Tagged:
  • anuragkumar
        5 years ago #16517

        Hi Team,

        Is there any way, we can set the values in table by scripting.I have a table in Scroll Container with around 40 columns. Its getting very difficult to map What I want to do is store the data returned from the Connector or Business object call into a global variable. And then I want to use a script to set the value from global variable into table. It becomes pretty tedious task to map the BO/Connector output parameter using UI action as in the attached image.

        Please suggest any easier solution.

        Regards
        Anurag

        Attachments:
        You must be logged in to view attached files.
        Stanislav Khodorov
            5 years ago #16538
            Up
            3
            Down
            ::

            Good day everyone!

            This is a very good question! Please resolve that!
            Also it would be quite nice to have a step by step guide: “How to set columnlistitems into a table with the correct data types, aggregations, items, structs…”. For low code users this seems to be very confusing. Please post that here, in addition please add a nice chapter into the documentation!

            Thank you and have a nice weekend!
            Cheers!

            Mathieu Roll
                Has successfully completed the online course Introduction
                Has successfully completed the online course Intermediate (200)
                Has successfully completed the online course Advanced (300)
                Has successfully completed the online course Basics (100)
              5 years ago #16554
              Up
              2
              Down
              ::

              Hello,

              please find attached an example where i’m generating a table with script.

              https://files.simplifier.io/f/545558de4f5a403c8e4e/?dl=1

              Stanislav Khodorov
                  5 years ago #16555
                  Up
                  1
                  Down
                  ::

                  Good morning Mathieu!

                  Thank you for providing the App! Still I experience some trouble with displaying the table.

                  The Connector in the example App works and it is loading data:

                  Console output from the connector

                  But the table is not filled with any values. Any idea why this could happen?

                  Table is not filled with values

                  I think there is either somewhere a hidden text element (which I don’t see in the Elements section during debugging) or the Mapping into the table entry is not correct. I can’t find the values within the HTML.
                  It is happening currently to most of my tables, beside the example apps like “ITIZ_Template_REST_ToDoList”.
                  To point it out further, if I edit the HTML element in the editor, the text appears in the table.

                  Editing App in the browser

                  Did you have this issue before?

                  Thank you very much for our support!
                  Have a good day!
                  Cheers!

                  anuragkumar
                      5 years ago #16561
                      Up
                      1
                      Down
                      ::

                      Hi @Mathieu,

                      How we can set the table aggregation data from UI designer itself, may be by setting some attribute with the struct field values, so that we need not map all the fields one bu one in the Connector/BO output mapping and just mapping the global struct variable would be fine?
                      It would be great if you can share the application transport file link if you have created one.

                      Regards
                      Anurag

                      Franz
                          4 years ago #20027
                          Up
                          0
                          Down
                          ::

                          Dear Simplifiers,

                          is there an updated transport available for version 5.0? The available file (https://files.simplifier.io/f/545558de4f5a403c8e4e/?dl=1) says “OK” at the dry run but fails with a postprocessing error when doing a real import.

                          Thank you

                          Franz

                          Mathieu Roll
                              Has successfully completed the online course Introduction
                              Has successfully completed the online course Intermediate (200)
                              Has successfully completed the online course Advanced (300)
                              Has successfully completed the online course Basics (100)
                            4 years ago #21767
                            Up
                            0
                            Down
                            ::

                            Hello Franz,

                             

                            please find a new Version of the Application here:

                            https://marketplace.simplifier.cloud/appDirect/SF_Marketplace/index.html#14

                            Gabriel
                                Has successfully completed the online course Introduction
                                Has successfully completed the online course Intermediate (200)
                                Has successfully completed the online course Advanced (300)
                                Has successfully completed the online course Basics (100)
                                Has successfully completed the online course Advanced (310)
                                Has successfully completed the online course Advanced (320)
                              3 years ago #27589
                              Up
                              0
                              Down
                              ::

                              Hi all,

                              regarding your Example, I tried to figure out how to delete a row in the table by using clientside BO ITIZ_Utilities –> “GetSelectedListItem”. The following error appears:

                              Error using clientside BO ITIZ_Utilities GetSelectedListItem

                              Thanks for your support in advance.

                              Cheers!

                              Vitali Kurdasov
                                  Has successfully completed the online course Intermediate (200)
                                  Has successfully completed the online course Basics (100)
                                  Has successfully completed the online course Advanced (310)
                                  Has successfully completed the Intermediate Certification
                                3 years ago #27599
                                Up
                                0
                                Down
                                ::

                                Hi Gabriel,

                                the call you are using seems to work only with elements bound via Simplifiers visualbinding.

                                In the example the table was bound via an ItemsPath, so the context of the model on pressing the item is not the view name but requires the name ‘variableHolder’.

                                Please create an new Clientside BusinessObject and create a Method analogous to “ITIZ_Utilities “-> “GetSelectedListItem”.

                                Afterwards change the scriptline 4 into:

                                var oOriginal = lo_listItem.getBindingContext(Object.keys(oSelectedItem.oBindingContexts)[0]).getObject();

                                We are currently working on a solution in ITIZ_Utilities to correct this error.

                                Gabriel
                                    Has successfully completed the online course Introduction
                                    Has successfully completed the online course Intermediate (200)
                                    Has successfully completed the online course Advanced (300)
                                    Has successfully completed the online course Basics (100)
                                    Has successfully completed the online course Advanced (310)
                                    Has successfully completed the online course Advanced (320)
                                  3 years ago #27627
                                  Up
                                  0
                                  Down
                                  ::

                                  Hi Vitali,

                                  thanks for the quick support. Changing the statement was not successful. oSelectedItem is not defined. But replacing ‘this.getView().getId()’ to “variableHolder” solves the problem.

                                  Jennifer Häfner
                                      Has successfully completed the online course Intermediate (200)
                                      Has successfully completed the online course Advanced (300)
                                      Has successfully completed the online course Basics (100)
                                      Has successfully completed the online course Advanced (310)
                                      Has successfully completed the online course Advanced (320)
                                      Has successfully completed the Intermediate Certification
                                      Has successfully completed the Advanced Certification
                                    3 years ago #27797
                                    Up
                                    0
                                    Down
                                    ::

                                    Hey Gabriel,

                                    Just in case this wasn’t clear before:

                                    Please make sure to create a new method in a new Client Side Business Object and change the code in this new method (from ‘this.getView().getId()’ to ‘variableHolder’). Do not change the code in the method from the ‘ITIZ_Utilities’ Business Object because this Business Object is part of our Standard Content and therefore may be overwritten, e.g. when you re-import the Standard Content.

                                    Also, other apps on your instance using the ITIZ_Utilities Business Object can be affected when you change the method. So the best solution is to create a new Business Object.

                                  Viewing 11 posts - 1 through 11 (of 11 total)

                                  You must be logged in to reply to this topic.