Dear All,
I am a beginner in OutSystems and I need your help. I have uploaded an Excel file using the Upload widget, and now I want to use a free API to retrieve addresses based on the pin codes in the file. When I enter a single pin code in a text input, the API works fine and displays the corresponding address in a table. However, I want to upload an Excel sheet with more than 100 pin codes. How can I retrieve the addresses for all of these pin codes using the API?
Please let me know if you need further clarification or information. Thank you in advance for your help.
Best regards,
Urvashi
HI @Urvashi Sharma
You are using this API : https://api.postalpincode.in/pincode/{PINCODE}
It's a GET api and accept only one Pin code, So you don't have any other option instead of call this API in loop,
You can find more details here
I hope it'll help you,
Thanks
Deep
Hi @Urvashi Sharma
Create a server action with one Input parameter of List of Text type or integer type and one Output parameter of List of Result (any structure which hold your record),
Then pass all pin codes in this server action and loop on the list of pin codes and pass the current pin code to the rest API and append the rest api response in your output list.
Hi @Deepsagar Dubey ,
Thank you so much for your kind support!!
It's working fine as I desired.
Regards,
Glad to help you,
Hi Urvashi,
Even though this is possible, you will be doing 100 calls to the API (one for each pin code). Wouldn't it be better to have a method on the API that receives a list of pin codes and returns a list of pin code - addresses instead? The API has this method or can you build it?
PZ
Hi Paula,
I use this API : https://api.postalpincode.in/pincode/{PINCODE}
Add below is the logic build on button click in GetPincode add a variable to store a text input value
Hi Deepsagar,
Can you help me how i can get result for all pincode in one attempt