how to link a database query to my list view

0
In my code, I make a connection to the postgres database and query the database to return some data.     I try to save this data that came in the query within my entity     It just doesn't seem to work, there is no data or my flow was not executed, can anyone help me understand?
asked
2 answers
0

What did you set as datasource of the listview? Database or microflow?

If database, it will retrieve the available records in the database.

In that case: the microflow FLUXO should be triggered before. Either by connecting it to a button which need to be pressed manually. before navigating to the page with the listview.

Another option is:

  1. Create a NEW microflow for example NAV_OpenHomePage
  2. Drag and drop the FLUXO microflow into the microflow > a action call microflow will be added, calling the FLUXO microflow
  3. Add a show page action > open the page now Home
  4. Set the target for the default home page to the microflow created in step 1

This will first trigger the DB connection and after this, open the page, which will fetch the data from the Mx database.

 

Although this should work, it might not be the desired process. guess its a test project. in that case; it works.

Otherwise, start with thinking through the process, when is the data required and thus the moment of connecting with the external database and how this data should be processed.

 

 

answered
0

I made this change

image.png

 

 

image.png

 

image.png

 

getting this error, 2024-04-02 15:12:01.605ConnectorAn error has occurred while handling the request. [User 'Anonymous_cf385d58-e656-42ff-88c0-2040109b3eca' with session id '44f934bd-XXXX-XXXX-XXXX-XXXXXXXX2713' and roles 'Administrator']2024-04-02 15:12:01.610ClientAn error occurred while executing microflow data source for widget MyFirstModule.home.lista: Internal server error Error: An error occurred while executing microflow data source for widget MyFirstModule.home.lista: Internal server error (...)

 

So does that mean that this flow doesn't start on its own, if there isn't a button to trigger it?

answered