API content in the feed

I am working with an API which needs country codes. On the frontend, where the user will input the data, I need it to state the country, but can I populate the dynamic field so the api understands this?
For example, the user selects UK in the dropdown, the API code for the UK is 2820 - how do I ensure the dynamic field on the API is populated with 2820 and not UK?

Did you create a DB of country or an Option set of country? Or do you have an API that populate the Country DD that also have the code?

I have a spreadsheet of the country codes

So first load your spreadsheet into a DB (easier, because you cannot import in option set actually). After, Create a dynamic dropdown with a Do a search DB
When you will call API, use Dropdown value’s code

Thank you. I now have the list populated from the database:

However, I cannot select the code in the value:

Select value, and you will have access to DB item fields.
Did you load Both name and code in your DB?

The DB fields are not being exposed:

I missed what you have set for the dropdown
Change type of choices for Country codes
Choices source will be Search for country codes
Option caption will be Current option name

Create an option set with country names and and an attribute as codes. Let users choose from this option set in a dropdown.

When a user selects a country, and proceeded, then inside API call reference that option set and get the chose code, and then just next add the user input.

make sure no spaces before, and in some cases use + for 00.

and make sure your input is TEXT(number) so user does not type text, and spaces which cause error.

If you still stuck, ping me and i will walk you through.

Thank you, I have it working. Very much appreciated.

1 Like