We have a requirement to populate USA address from a third-party service using auto-complete. The third party have two services,
one for populating the address details like line1, line2, city, state and country.
The second one being the service to get postal code and county(note: it is not country).
I could call the second service in the response data transform of first service and set the postal code and county easily.
But it’s impacting the performance of the auto-complete and search results are taking time to load.
So, to overcome the performance problem, I am trying to call the second service on ‘Change’ event of the auto-complete property. But it’s not triggering the event and not calling the activity/data transform.
Has anyone faced the issue? Any workarounds for the issue that I am facing? Inputs would be greatly appreciated.
Have you tried tracing the activity/data transform to confirm whether it is running on change?
I just tested autocomplete on change action and it is working as expected.
Note: if you are trying to show data from the service response on change of the autocomplete, then you should use the Refresh Section action and call the activity/data transform there so that the front end is updated with the new clipboard data.
You can also configure something similar in App Studio as a reference: configure a data reference property with a search mechanism and it will autogenerate this UI using standard data pages, then you can just customize by adding your custom activity/data page source as needed.
@JoeH9464 Thanks for taking time and looking into it.
I retested all the events and traced it again today. Looks like the DT/activity is getting called on most of the events like ‘click’, ‘double-click’ but not on ‘change’. Interestingly it triggers on change when I change the ‘results display’ to ‘in a list’ in the presentation tab(attached the screenshot). But it’s impacting the set value fields that I did in the General tab from data page to the page I am showing on UI.
Could you please check the ‘results display’ field in the presentation tab at your side?
@GowthamA3261 I appreciate you looking into this. Nice POC!
I have only one box to enter address and I need to call two services sequentially. So I am trying to call the second service on ‘on change’ and it does not trigger. Can you please call setting the county on ‘on change’ and see if it calls the DT/activity?
I am not getting that ‘Use for Search’ radio button. I am on 8.5.3, Looks like you are on a different version. However it should not matter.
@AbdulShaik I am able to trigger a DT with “on change” of auto complete and load 2nd datapage D_CountyList in it. Using 8.7
Can you clarify your use case? When first API results are in D_AddressList & second API results are in D_CountyList how do you intend to show them in same autocomplete field?
@GowthamA3261 The DT is not being called for me with ‘on change’ of auto-complete for some reason.
My use case is - I have two services.
to get address line 1, line2, city and state
to get county and zip code by passing the values from service 1.
The auto-complete DT calls the 1st service(fine till now), and trying to get the county and zip code from service 2 by calling the Data page/service via a DT. But the on-change event is not triggering.