I was trying to fetch the data from a doctype and show that in a form dropdown, I tried by using data script and configured data key to the field but this didn’t work
data.paddles = frappe.db.get_all("Paddles")
above is the data script i used .
Don’t know what mistake i am doing here
1 Like
Hi @cherrycharan,
For Dropdown, use Select Tag and Then Add Options Tag in it. Wrap this Options Tag in a Container and Repeat this Block. Set Your Data Key paddles for this repeated block. And Set Data Key name for Options. Your structure will be look like

Hope this helps you.
Thanks,
Daizy Modi
6 Likes
@DaizyModi Thanks! This worked
@DaizyModi are there any official docs available for the repeater?
Can you tell us the way to pass an array of values and dictionary.
Hi @Mohammad_Ahmad_Zulfi,
Please follow the steps mentioned earlier.
As a reference, you can use Data Script(from sidebar) to fetch a list of documents and set it as the data source for a Repeater block in Frappe Builder.
You can refer to the official documentation here:
https://docs.frappe.io/builder/data-script#fetching-a-document-list
Example:
To fetch a list of Customers, you can use the following in your Data Script:
customers = frappe.get_all("Customer", fields=["name", "customer_name"])
This customers variable will now hold a list of customer records.
Set this as the data key in the Repeater block settings (Refer SS).
Make sure the data key used in the Repeater matches the variable name defined in the Data Script.
Thanks,
Daizy Modi
2 Likes
Hi @daizymodi!
Sorry but I have a question.
I have this situation:
I would to fetch data “att_icon” and “att_title” inside “items” inside “attivita” in turn.
If i set “attivita” in repeater’s key and “att_icon” and “att_title” in an image key and a text key it not works
I think that the problem is that “items” is nested inside “attivita”.
How can I get data from “items”?
I was able to create the options for select field successfully. However I am not sure how to set the value property on the options dynamically. I tried to use the variables and the do work but the context is not correct.
For example in the example attached below. You can see the title is coming fine however I also want to set the name as the value of the options. When I add the name as variable it picks the name of the page instead
I was able to add the value attribute dynamically. Had to look into the source code. My question that will it better to provide option to have multiple Data Key bindings? Like I wanted bind the value attribute and the innerHTML property. As a work around I had to add a span in the options separately.