[Qgis-user] Add Layer Search to Toolbar

Andreas Neumann a.neumann at carto.net
Fri Nov 13 08:37:15 PST 2020


QGIS allows you to setup relations between different data sources. But 
of course you need common keys to link the tables.

So you could have a relation between a Oracle DB and a CSV file. But you 
need to setup this relation with the foreign key manually in menu 
"Project" --> "Properties" --> "Relations".

Once you've set up these relations you can use the relation reference 
widgets in the forms.

Andreas

Am 13.11.20 um 17:33 schrieb L.W.:
> thats true, but i need to add the foreign key to work with this relation.
>
>
> Am 13.11.2020 um 17:10 schrieb Andreas Neumann:
>> Hi,
>>
>> To me this sounds like you want to set up a relation and define forms
>> with relation reference and relation widgets (with or without embedded
>> forms).
>>
>> In the project settings you can define relations between tables and
>> once you have defined them, they appear in the forms section of the
>> involved layers.
>>
>> But as others have pointed out, you probably want (or need) a proper
>> database, like PostgreSQL. If you have setup your relations in this
>> database, QGIS will autodetect them and you can directly use them in
>> your forms.
>>
>> Greetings,
>>
>> Andreas
>>
>>
>> Am 13.11.20 um 16:58 schrieb L.W.:
>>> Use-Case:
>>>
>>> I add a Point on map, the attribute-editor opens and I give some Data
>>> to it.
>>>
>>> want-to-have:
>>>
>>> I want to add a foreign-Key id, but can not add a search-form in this
>>> gui. so my idea was to search in the foreign table with a search-term
>>> and get the id of the found row.
>>>
>>> with this id I can add the new point.
>>>
>>>
>>> my biggest problem, I do not like python as much ... I can write
>>> 'python' but none line of code ;-)
>>>
>>>
>>> Am 13.11.2020 um 16:52 schrieb Richard Duivenvoorde:
>>>> Please describe your use-case more specific.
>>>>
>>>> What is the end result you want:
>>>> - a location?
>>>> - a value of a record (but not the one you search for?
>>>>
>>>> Can you use the filter function in the table? And maybe dock the
>>>> table as a dockwidget?
>>>> Can you implement a 'locator' yourself (python coding)?
>>>> Or else write a small plugin for this?
>>>>
>>>> Regards,
>>>>
>>>> Richard
>>>>
>>>> On 11/13/20 4:43 PM, L.W. wrote:
>>>>> and this is the point:
>>>>>
>>>>> "With f @columname you search in the values of 'columname' in current
>>>>> active layer"
>>>>>
>>>>> I do want to search every time independant of the active layer ... 
>>>>> and
>>>>> the search-field is not the result-field I need.
>>>>>
>>>>>
>>>>> Am 13.11.2020 um 16:37 schrieb Richard Duivenvoorde:
>>>>>> Have a look in the settings/configure (right mouse context in the
>>>>>> locator bar).
>>>>>>
>>>>>> With f ... you search in current active layer
>>>>>> With f @columname you search in the values of 'columname' in
>>>>>> current active layer
>>>>>>
>>>>>> (same with 'af' but then for all layers)
>>>>>> See
>>>>>> https://docs.qgis.org/3.16/en/docs/user_manual/introduction/qgis_configuration.html#locator-settings 
>>>>>>
>>>>>>
>>>>>> Hope this helps
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Richard Duivenvoorde
>>>>>>
>>>>>> On 11/13/20 4:30 PM, L.W. wrote:
>>>>>>> no, I have never used it, but, there are a hugh list of layers in
>>>>>>> my project and it seemed that I can not search in a specific layer.
>>>>>>>
>>>>>>> I only need result of one field displayed in a text field.
>>>>>>>
>>>>>>>
>>>>>>> Am 13.11.2020 um 16:24 schrieb Jorge Gustavo Rocha:
>>>>>>>> Hi L.W.,
>>>>>>>>
>>>>>>>> You already have a search toolbar, at the lower left corner.
>>>>>>>> There are several search options. Have you tried them?
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Jorge Gustavo
>>>>>>>>
>>>>>>>> Às 14:39 de 13/11/20, L.W. escreveu:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> is there a default option / way to have a textfield for
>>>>>>>>> searching in a
>>>>>>>>> layer at the toolbar (or dock-window)? Ill like to get the
>>>>>>>>> "fieldname"-value of the found dataset / attribute.
>>>>>>>>>
>>>>>>>>> regards
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Qgis-user mailing list
>>>>>>>>> Qgis-user at lists.osgeo.org
>>>>>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>> -- 
>>>>>>>> Email Signature
>>>>>>>> Logo <https://www.geomaster.pt>
>>>>>>>> *Geomaster*
>>>>>>>> *Jorge Gustavo Rocha* | Software Engineer
>>>>>>>> *e:*jgr at geomaster.pt | *m:*+351 910 333 888
>>>>>>>> *g:*41.54094,-8.40490 | *v: *510 906 109
>>>>>>>> *a: * Rua António Cândido Pinto, 67, 4715-400 Braga
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Qgis-user mailing list
>>>>>>>> Qgis-user at lists.osgeo.org
>>>>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>> _______________________________________________
>>>>>>> Qgis-user mailing list
>>>>>>> Qgis-user at lists.osgeo.org
>>>>>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the Qgis-user mailing list