01-17-2023 12:25 PM
Hello,
Does anyone have a sample query of how to call values in a dataset (e.g. Country codes) so it can be listed in a drop down menu in a user request form? I have looked through the user management form documentation and I didn't really find any.
Thanks
Solved! Go to Solution.
01-17-2023 12:59 PM
Can you provide the sample data for you dataset that you want display in user form?
Choose attribute type of the respective field on user form and SQL ENUM and In general you can use below query, If you have multiple columns then you may have to modify the query accordingly
select distinct attribute1 as ID from dataset_values where dataset_values.datasetname ='<dataset_name>'
01-17-2023 08:25 PM - edited 01-17-2023 08:26 PM
Thanks this was helpful!
I have two columns in the dataset; Country and Codes. In another attribute I want to display the code when a user selects the country. For example, when a user selects United States in the Country attribute (in the form) I want to display the corresponding Code in the country Code attribute. keeping in mind that I am pulling the data from the dataset, do you have any idea how that can be achieved?
Thanks for your help
01-17-2023 08:53 PM - edited 01-17-2023 08:54 PM
Example Dataset
Attribute 1
select distinct attribute1 as ID from dataset_values where dataset_values.datasetname ='Country'
Attribute 2
select distinct attribute2 as ID from dataset_values where dataset_values.datasetname ='Country' and attribute1 = '${Country Name}'
01-18-2023 07:49 AM - edited 01-18-2023 07:54 AM
I have followed this step, however when I select a country in the country attribute the code doesn't show in the code attribute in the user form. when I clicked directly on the country code attribute I got the message "error occured".
I tried placing the single quotes inside the country name like this ${'Country Name'}, and didn't receive the error, however, the country codes still weren't showing. When I do click directly on the drop down menu in the country code attributes it says no matches found
01-18-2023 07:59 AM
Change below things
01-18-2023 08:15 AM - edited 01-18-2023 08:17 AM
I have the made these changes but it's still not working. Please see screenshots below.
I tried the single quotes both inside and out. '${DA1}' and ${'DA1'} and it's the same result
01-18-2023 08:26 AM
Use query as below for DA2
select distinct attribute2 as ID from dataset_values where dataset_values.datasetname ='Countrycode' and attribute1 = ${DA1}
01-18-2023 03:33 PM
Thank you for your help!
01-18-2023 08:06 AM - edited 01-18-2023 08:08 AM
Can you share the screenshot of both dynamic attributes configuration?
Below is the sample configuration we did which of similar use case. You don't have use single quotes with in variable can you try variable as ${Country Name}
01-18-2023 08:14 AM
Attribute 1
select distinct attribute1 as ID from dataset_values where dataset_values.datasetname ='Countrycode'
Attribute 2
select distinct attribute2 as ID from dataset_values where dataset_values.datasetname ='Countrycode' and attribute1 = ${'DA1'}
01-18-2023 08:26 AM
select distinct attribute2 as ID from dataset_values where dataset_values.datasetname ='Countrycode' and attribute1 = ${DA1}
01-18-2023 03:32 PM
Thank you so much for your help! This worked
01-18-2023 06:00 AM
Yes, Let say you data set name is Country Codes and in column1 you have country and cloumn2 you have codes. Also on user form field name for country is Country then queries goes like this.
select distinct attribute1 as ID from dataset_values where dataset_values.datasetname ='Country Codes'
select distinct attribute2 as ID from dataset_values where dataset_values.datasetname ='Country Codes' and attribute1='${Country}'
01-17-2023 01:09 PM
select distinct attribute1 as ID from dataset_values where dataset_values.datasetname ='Country Codes'
01-19-2023 06:28 AM
Great. Can you please mark the solution that worked to close the thread. so that others who are on same boat it will be helpful