Select to view content in your preferred language

Survey123 autocomplete search on csv

1672
4
Jump to solution
10-25-2023 09:43 AM
ChristopherMask
Regular Contributor

Hello Community,

Not sure why I can't filter the csv by ResourceType, but could use some assistance if you have time. Attempting to autocomplete search on the ResourceRates.csv by using autocomplete search as seen below.

type

select_one_from_file ResourceRates.csv

 

appearance

autocomplete search('ResourceRates','matches','ResourceType','Equipment','ResourceType','Equipment')

 

choice_filter (not sure this matters)

selected(${CalendarYear},YearOfRate)

 

Christopher

1 Solution

Accepted Solutions
ChristopherMask
Regular Contributor

So, the choice_filter now contains this statement:

selected(${CalendarYear},YearOfRate) and ResourceType = 'Equipment'

That now filters the csv list.

Thanks

View solution in original post

0 Kudos
4 Replies
abureaux
MVP Frequent Contributor

1. You are using a reserved name in your "name" column. You should change this as it may cause issues:
abureaux_1-1698258595285.png

2. You have several lines in your CSV with empty data. This may cause issues. You should fill in those lines or delete them:

abureaux_2-1698259065948.png

 

You shouldn't need the search() appearance at all if all you are just filtering a list. Instead, use choice_filter. Your current choice filter is set to a column with all the same data. I.e., If you enter anything other than "2023" you will get nothing. If you enter "2023" you will get everything:

abureaux_3-1698259330699.png

abureaux_4-1698259338305.png

What exactly are you trying to narrow this list down to?

ChristopherMask
Regular Contributor

The list should only show items where YearOfRate = 2023 and ResourceType = Equipment. 

 

 

0 Kudos
abureaux
MVP Frequent Contributor

That makes the filter pretty easy:
selected(${CalendarYear},YearOfRate) and selected(${ResourceType},Resource)

abureaux_0-1698260180463.png

Results in:

abureaux_1-1698260206004.png

It appears that your CalendarYear and ResourceType fields are hidden calculates. If you use this choice_filter for your dropdown and experience any issues, ensure that 1) you have filled in those fields, and 2) those fields are returning the expected data. You can always temporarily show those fields for testing to ensure they are doing what you want (similar to my example above).

0 Kudos
ChristopherMask
Regular Contributor

So, the choice_filter now contains this statement:

selected(${CalendarYear},YearOfRate) and ResourceType = 'Equipment'

That now filters the csv list.

Thanks

0 Kudos