How to implement a drop down while the content is from a microflow call?

0
Hi I am trying to implement a functionality. While user types in Address with either house no or postcode, it triggers a microflow to return a list of possible Addresses.  I want to show the Addresses in a drop down list and the user can select and save. I am thinking to use reference selector but I am not sure how it works. It seems only works for persistent entities? Can someone help please?
asked
3 answers
6

Hi Ping,

You could do this with a microflow datasource as follows. In my example I used a non persistent Search entity connected to the the address entity.

I created a page with the Search entity as dataview, used a Input attribute and put a reference selector for the association to Address. I then used a microflow as datasource in which I gave the Search object as parameter.

I put an onchange event on the input field and refreshed the search object triggering a new request to the reference selector datasource microflow to refresh it's possibilities. After this you can use the input variable in a xpath to retrieve the values you want with queries like:

[Street = $Search/Input]

or

[contains(Line,$Search/Input)]

The Line attribute is a complete address line in my case which i filled in a before commit with all the values of the other attributes. Opening possiblities to easely implement a generic search on the input. However, it comes with a con and that is that the contains is translated to a ILIKE statement which is not efficient. So the retrieve is inefficient when used against tables with larger set's of data.

I hope you can translate this example to your project.

Regards

answered
0

Hi Ping,

So in case you want to fire the microflow on every keypress you can use the OnChange Inputbox from the app store:

https://github.com/mendix/OnchangeInputbox

I hope this answers your question in total.

Regards,

answered
0

I tried the OnChange inputbox, however, it seems not working with reference selector? I used it, but the drop down was never updated. I am not sure why.

answered