Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Data Table Purge

    Posted 02-20-2025 02:34
    No replies, thread closed.

    Hi,

    Has anyone achieved purging / clearing data table rows using a flows/datatables API. Looking to build in a process that clears rows based on a row field entry (UTC date). I can perform this manually, i.e. exporting / importing, but was hoping to automate.

    Thanks,


    #Unsure/Other

    ------------------------------
    Neil Jones
    Voice Comms Lead
    Awaze Uk
    United Kingdom
    neil.jones@awaze.com
    ------------------------------


  • 2.  RE: Data Table Purge
    Best Answer

    Posted 02-20-2025 04:08
    No replies, thread closed.

    Hi,

    One way to achieve this is to create a Workflow with the logic to get and delete the table row(s). And use a Trigger to fire the workflow..



    ------------------------------
    Cheers
    Zubair
    ------------------------------



  • 3.  RE: Data Table Purge

    Posted 02-21-2025 04:07
    No replies, thread closed.

    Thank you, and I'm reviewing how to utilise a workflow for this requirement.



    ------------------------------
    Neil Jones
    Voice Comms Lead
    Awaze Uk
    United Kingdom
    neil.jones@awaze.com
    ------------------------------



  • 4.  RE: Data Table Purge

    Posted 02-21-2025 15:28
    No replies, thread closed.
    get /api/v2/flows/datatables/{datatableId}/rows will give you a list of all the rowid values for the datatable, then iterating through 
    delete /api/v2/flows/datatables/{datatableId}/rows/{rowId} will let you delete each row, one by one...that can hit rate limits if not handled carefully
     


    ------------------------------
    George Ganahl GCP, GCSME, ICCE, ICHD, etc.
    Technical Adoption Champion
    Genesys
    ------------------------------



  • 5.  RE: Data Table Purge

    Posted 02-23-2025 23:39
    No replies, thread closed.
    Jones, Neil reacted to your message:





  • 6.  RE: Data Table Purge

    Posted 04-17-2025 05:44
    No replies, thread closed.

    Hi George,

    Your API suggestion works perfectly.

    Still have an issue with rotating through records though, i.e. if a record needs to remain due to a data table field (expiry date) not in the past. My data table is populated following a web message survey acceptance prompt (where I verify email, name and also stamp the interaction UTC time, and a survey expiry - interaction UTC time +72 hours). My workflow works, using your suggestion, providing all records have a expiry date of more then three days prior to the workflow run time.

    The issue I have is if a record needs to remain how do I make the workflow look at the next record, i.e. record 1 expiry date is not more then three days in the past, but record 2 is ?

    Thanks,



    ------------------------------
    Neil Jones
    Voice Comms Lead
    Awaze Uk
    United Kingdom
    neil.jones@awaze.com
    ------------------------------



  • 7.  RE: Data Table Purge

    Posted 04-17-2025 08:10
    No replies, thread closed.
    GET /api/v2/flows/datatables/{datatableId}/rows
    Returns the rows for the datatable with the given id. Returns all of the rows for the datatable with the given datatableId. By default this will just be a truncated list returning the key for each row. Set showBrief to false to return all of the row contents.
    You'd probably have to return all the row data instead of just the RowId and in your workflow check each row for the datetime and decide whether or not to delete that row.
    You'd need all the rows in a collection, and use you loop index to designate which row to look at/delete each time, presuming you are using a loop in the workflow to do the work.
    That's off the top of my head.


    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME, ICCE, ICHD, etc.
    Technical Adoption Champion
    Genesys
    ------------------------------