<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Chris,</p>
<p>There is the "Value Map" alternative, which loads the value and descriptions from an existing layer and you can remove that value layer afterwards. The drawback is that it isn't a "live link". So if you change your value table you have to manually resync the data. The values and descriptions are then stored in the project and exported/loaded with the style.</p>
<p>-----------------</p>
<p>There is a project just about to be started that more intelligently loads data from PostgreSQL (project generator). But this won't be available until 2017. Meanwhile, if your data is in PostgreSQL, you can also use the "Data driven input mask" plugin from Bernhard Ströbl - which does exactly that, but from a Python plugin.</p>
<p>Greetings,</p>
<p>Andreas</p>
<p>On 2016-07-18 13:28, Chris Buckmaster wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored --><!-- meta ignored -->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">Hi Andreas<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">Thanks for confirming – I think I understand your approach, but is there a way to store these values in the widget properties, perhaps under value map then so the separate table may not be required?<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">There will be occasions where a user will want to add the spatial layer from the PostGIS connection, but they wouldn't necessarily know that other tables need to be added as well which link to that.<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">Thanks<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<div>
<div style="border: none; border-top: solid #B5C4DF 1.0pt; padding: 3.0pt 0cm 0cm 0cm;">
<p class="MsoNormal"><strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif';">From:</span></strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif';"> Neumann, Andreas [mailto:a.neumann@carto.net] <br /><strong>Sent:</strong> 18 July 2016 12:22<br /><strong>To:</strong> Chris Buckmaster<br /><strong>Cc:</strong> qgis-user@lists.osgeo.org<br /><strong>Subject:</strong> Re: [Qgis-user] Value relation option in QGIS<!-- o ignored --></span></p>
</div>
</div>
<p class="MsoNormal"><!-- o ignored --> </p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana','sans-serif';">Hi Chris,<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana','sans-serif';">Yes - you need both tables in the QGIS project. I usually create a separate group for the value list tables at the bottom of the layer manager.<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana','sans-serif';">Andreas<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana','sans-serif';">On 2016-07-18 12:58, Chris Buckmaster wrote:<!-- o ignored --></span></p>
<blockquote style="border: none; border-left: solid #1010FF 1.5pt; padding: 0cm 0cm 0cm 5.0pt; margin-left: 0cm; margin-right: 0cm;">
<div>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">Hi<!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">I have a field in a PostGIS table for which I would only like the user to be able to select a pre-defined value.<!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">Along with my table, I have created a separate PostGIS table listing out those values that I would like the user to be able to select. I filled out the options within the value relation widget for my layer, but have found that when I bring my table back into my project after saving it, I am unable to see any options in the drop down menu it shows (I saved my style when I set the value relation widget properties).<!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">The error I get is regarding permission denied for the sequence (as I have a primary key field in my main table, although I have made sure the user has all access).<!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">Just wondering what possible issues I might be having? Do I need my non spatial table in the project as well? I can provide any further information as required.<!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;">Thanks, Chris <!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
<p class="MsoNormal" style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"> <!-- o ignored --></p>
</div>
<p class="MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana','sans-serif';"><!-- o ignored --> </span></p>
<div>
<p class="MsoNormal"><span style="font-size: 10.0pt; font-family: 'Courier New';">_______________________________________________<br /> Qgis-user mailing list<br /><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><!-- o ignored --></span></p>
</div>
</blockquote>
<p><span style="font-size: 10.0pt; font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
<div>
<p class="MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana','sans-serif';"> <!-- o ignored --></span></p>
</div>
</div>
</blockquote>
<p> </p>
<div> </div>
</body></html>