Skip to main content
Topic: Set Field Datasource (Read 980 times) previous topic - next topic

Set Field Datasource

Hello,
I am trying to have a field in a entry form to be populated from a query.

I use a textbox  and select the "AutoCompleteDataSource" where I selected a Custom SQL

in the Sql Query editor I enter the following
 
"SELECT  DISTINCT id AS value  FROM tbl_master WHERE is_current =1

I tested it and it indeed return a "value" of 8.

What do I have to do for this value to be enter in the field automatically?

Thank you.

Re: Set Field Datasource

Reply #1
@cpfavre‍ please note that AutoCompleteDataSourrce is used to load suggestions for end-users as they input data in the current field. it is not used to automatically select data from the database and load it on the input. If you want a value to be loaded on add page when the page loads, then use DefaultValue configuration.

 

Re: Set Field Datasource

Reply #2
Thank you, noted.

Can I enter a query in the default value? and how?  Is there any documentation / video?
What I am asking does not seem out of the ordinary? :-) or maybe there are other ways to achieve this.
Thank you.


Re: Set Field Datasource

Reply #4
Hi, I dont see any option in the "DefaultValue", see attachement.

Re: Set Field Datasource

Reply #5
Works with the classic version and not with the vue.