This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

External Database insert value list item selected value

Hello everyone,

I tried to insert the list value use external database connection configuration
as a result it inserts the id of the list value
i need to insert the selected list value name, how do i do that ?
 
  • When setting up your external database connection configurations the values that are inserted into the value list need to be associated with the "Name or title" target property. 

    For example if the SQL query is : SELECT ID , ValueName FROM Table

    Then your columns mapping section should link "ID" to the "Object ID" target property , and the "ValueName" to the "Name or title" target property

  • Actually, I already use them for starters. For example, I have a list named countries, when I select "england", it sends the "id" value in the list instead of the "name" value in the list.

  • I think I may have misunderstood the question, are you updating/adding an new object in M-Files, which is configured as an external DB object? If so I think this is actually by design, I believe in the background M-Files references value list items by ID not by value. That way if the value of an item in the VL were to change for some reason it would still have a pointer to its Unique object id and retroactively update all objects that are referencing that ID to display the correct value. 

    If you want the DB table for the external object to display the Value instead of the ID, I believe a workaround for this would be to set up the value list to have the same value for the object ID and the Value for example 

    SELECT ValueName as [object id ], ValueName as [name or title] FROM Table

    However, if you do this approach, you can run into some issues, for example if the valuesNames in the Database change. If the value name was changed in the DB, M-Files would interpret the rename as if you deleted the original Value, and created a brand new item with a different value. This would also result in all objects referencing that original VL item to display as {original value} (deleted).