Filter Dropdown of Options by User's Country

Friends,

I have this in set up:

  1. Option set - “Software”: It has all 30-40 options of names of softwares.
  2. Option set - “Country”: It has names of 5-6 countries.
  • in Country, there is an Attribute - 'Software" which is set as a “list of Software”…
  • I then select the Software specific to each country from Modify attribute step.
  • like this each country has a few options of software assigned to them.
  1. My users Also have their address saved in the App database using google maps API…so it is an official, detailed address.
    For example… 123 Street, Richmond, CA, USA.

  2. Next, In the app set up, there is a dropdown to Select Software.

How to set up the Choices Source in such a way that:

  • if User from USA country = in the dropdown they only see list of options of Software which are assigned to USA

  • if user from Canada = in dropdown they only see list of options of software which are assigned to Canada.

ChatGPT told me that the “country name” in my address and “country options” in my Country option set should match exactly in order for bubble to pick up the option source correctly. I did that. For eg, if the country of User is saved as USA then make sure to also name country option as USA so there is a match.

(i assume that you do not need to save user’s country separetely coz it already exists in the Address fields… so when tying to set Constraint i did Current user’s address’s Extract:Country)

any help is appreciated.

For more info, This is my database set up:

Hi applepatient,

Where you have the choices source I would get All the Country’s, filter how needed and then display the List of softwares related to that country. I don’t think this is the most efficient way to do it but it would work. You could also attach the Country to the user and save it when you save the users address. Then the Choices source would be “Current users, Country’s, Software”

1 Like
  1. with this i seem to have problem getting the expression to be correct. I tried many variations of building this expression.

Choice source: All country:filtered- constraint: Current page’s pharmacy’s Address:extract Country - is - This Country’s Software (this failed)

Then i tried- All country’s :filtered:each item’s software > constraint - current page’s pharmacy’s address:extract Country - is in - this country’s Software: each item’s Display.

Then i also tried this:

  1. With this option, Do i need to separately explicitly create an extra field for “country” in user’s data type? Is it more efficient than above method?

Thank you, please advise whatever you think is best… i do not mean to keep asking for free. i will not ask a follow up question, you already did a favor answering this.

Your constraint is wrong. It should be Current Users’s Address extract country is This County’s Display.

You just need to make sure that the text that is returned from Current Users’s Address extract country is exactly the same as the text you have for the Country in your option set.

1 Like

It worked, thank you thank you thank you jonathan. I had to use debugger to see what the country name looks like.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.