Workflow with succession of API calls and different tables

Here is what I want to achieve:

  • call a first API which returns a list of strings
  • show the list in a table
  • select one of the string
  • use it as a parameter for another API which returns another list
  • show this list in a table

How can I switch all the content of the table, if the content has the same structure?
How can I switch to another table if the content has a different structure?