Genesys Cloud - Main

 View Only

Discussion Thread View
Expand all | Collapse all

Script: How to show data in tabular format? (side by side instead of list)

  • 1.  Script: How to show data in tabular format? (side by side instead of list)

    Posted 04-08-2024 10:38

    Hello Folks,

    I am looking for a way, wherein I can design script to show data in a tabular format, instead of showing as a default list. Something like below (I have designed this in MS Paint to describe my requirement):

    Any idea on this will be greatly appreciated.


    #ArchitectureandDesign

    ------------------------------
    Khurshid Ali,
    Consultant / Developer / Tech Lead,
    NCR Voyix,
    khurshid.ali@ncrvoyix.com,
    New Delhi,
    India
    ------------------------------


  • 2.  RE: Script: How to show data in tabular format? (side by side instead of list)
    Best Answer

    Posted 04-09-2024 03:14

    Hi Khurshid Ali,

    On the main Vertical stack container, you can please a horizontal stack container and then with in Horizontal one place two vertical stack containers to achieve what you are showing on your image. 

    It looks some thing like this : 

    Hope this helps.

    Thanks,



    ------------------------------
    Ramu P
    Global Technology Solutions, LLC
    ------------------------------



  • 3.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 04-09-2024 05:45

    Yo can also use the new functionality "Markdown"

    and type a table like this(just and example)

    |**Datos cliente** || | :--- | ---: | | **Nombre Completo:** | {{SMKNOMP}} {{SMKCOG1}} {{SMKCOG2}} | | **NIF:** | {{NIF}} | | **Prest. Canales:** | {{WS_mf_prestamoCanales}} | | **Prest. Oficinas:** | {{WS_mf_prestamoOficinas}}| | **Fecha Nacimiento:** | {{DATNAC}} | | **Telefono:** | {{TELEF}} |

    So it looks like this(just and example):



    ------------------------------
    David Fradejas Tomás
    Sabio Ibérica, S.A.
    ------------------------------



  • 4.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 04-09-2024 09:41

    Thanks for your response David. This looks interesting.

    When i select Markdown, it just opens me a box, like shown below . How have you done that? 

    Is it like calling vertical container in a horizontal container?

    I was able to achieve with what Ramu shared above, but wanted to learn Markdown. I have not used it so far. How to configure as you have done?
    Will you be able to share a export of it?



    ------------------------------
    Khurshid Ali,
    Consultant / Developer / Tech Lead,
    NCR Voyix,
    khurshid.ali@ncrvoyix.com,
    New Delhi,
    India
    ------------------------------



  • 5.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 04-09-2024 12:52

    Markdown is a shorthand that lets you quickly format text:

    https://help.mypurecloud.com/articles/markdown-script-component/



    ------------------------------
    David Fradejas Tomás
    Sabio Ibérica, S.A.
    ------------------------------



  • 6.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 04-09-2024 13:23

    Hey David, 

    Thanks a ton. This is wonderful. Much easy to see lot of data in one view without having to scroll through.

    I am going to use this more and more now.

    Regards.



    ------------------------------
    Khurshid Ali,
    Consultant / Developer / Tech Lead,
    NCR Voyix,
    khurshid.ali@ncrvoyix.com,
    New Delhi,
    India
    ------------------------------



  • 7.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 04-09-2024 09:31

    Thanks for the response. It solved my issue. 

    Though, Genesys should think of adding more flexibility to it by adding tables format as well.

    Regards



    ------------------------------
    Khurshid Ali,
    Consultant / Developer / Tech Lead,
    NCR Voyix,
    khurshid.ali@ncrvoyix.com,
    New Delhi,
    India
    ------------------------------



  • 8.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 04-09-2024 09:35

    agree, glad it helps



    ------------------------------
    David Fradejas Tomás
    Sabio Ibérica, S.A.
    ------------------------------



  • 9.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 8 days ago
    Edited by Ru Ratnasuriya 8 days ago

    Hi All,

    I've been trying to get this to work on my script with no luck. At the moment, all I'm trying to do is display approx 7 column headers in a table before moving to the rows but after following the Resource Centre markdown script and reading the github pages and these forums, I am unable to get any other example markdown script for tables to work - even your script above, David, for Datos cliente etc doesn't work for me.

    I have been able to amend text to be bold using the associated shorthand  **xyz**

    but the shorthand for Tables is not displaying the text in table and just showing it as the text as : | Column1 | Column2 | Column3

    I've tried

    |Ticket | Summary | Status |

    | - - - - | - - - - - - - - | - - - - - - |

    | {{ticketNumber}} 

    But it displays like

    If I copy and paste David's example above, the script preview is:

    I have tested other markdown shorthand and they are working: emojis, strikethrough, coloured text.

    I am after a dynamic table where the column headings stay the name and the rows populate depending on the number of records returned from a Get Data Action

    | Heading A| Heading B | Heading C |
    | – – – | – – – | – – – |
    | content 1a | content 1b | content 1c |
    | content 2a | content 2b | content 2c |
    .
    .
    .
    | content na | content nb | content nc |
    I'm either missing something obvious or it's a fault. I've tried mixing up the pipeline and text/hyphens with and without spaces. Having all the pipelines all in a row or split on each row as required with no luck. No table is seen just the column headings surrounded by pipelines

    Appreciate any feedback



    ------------------------------
    Ru Ratnasuriya
    ------------------------------



  • 10.  RE: Script: How to show data in tabular format? (side by side instead of list)

    Posted 7 days ago
    Edited by Ru Ratnasuriya 7 days ago

    Hi All,

    Found the issue. Found that if written straight into Genesys script markdown component - it won't work

    But same format/shorthand written in notepad and copied over to markdown component works

    See screenshots below:
    In the Edit version of the script: the top three examples testing the table shorthand in markdown components have been written outside of the Genesys script mark down component - ie in Notepad and copied into Genesys

    Bottom example is the same as the top example but written directly in to the Genesys script markdown component.

    Script Editor

    Script Preview



    ------------------------------
    Ru Ratnasuriya
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources