Two data sources, one output

Up to this point, my projects have had a single datasource, so querying with joins makes returning a single dataset straightforward. But what to do when you have two datasources where joins are not possible?

Wappler makes it easy by using the repeat action and clever output options.

The two datasources: ‘hc’ is mysql, and ‘hcinternal’ is mssql on a remote server.

query_job_orders gets the baseline information but I don’t output the query itself as I normally do. A repeat is used for the output, and I select the output fields. Within the repeat, job_name goes to the remote database and gets another value I need, and by setting a value in the repeat, it is adjoined with the other fields, as if it had been in the original query.

In the end, you get the same type of output:

7 Likes

Wappler is a remarkable tool :slight_smile:

1 Like

yes that is the way to do it :slight_smile:

In the future we might add more collection formatters/mutators allowing you to auto join two different data collections (from different sources) with operations like you have in sql union, like:

2 Likes

Now that’s possible:

2 Likes

That’s already possible using the Server Connect Array List component:

This topic was automatically closed after 26 hours. New replies are no longer allowed.