The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

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

Can an External Connection populate a Lookup Field by Display Name

I have an Object Type "Country" where the Name Title is the country text (we're not using any localizations). I have a Customer Database that I am importing via the External Database Connection into Customer Objects. One Property on the Customer Object is Primary Country which is a Lookup on the Country Objects. In the external database, the Country field has the country name string in the value. Importing this does not succeed in setting the lookup property. In this case I have no mechanism for getting the MFiles Object ID of the country into the SELECT query for the Customer Record to make the import work. I feel like there must be some way to have this work off of the Display value of the Lookup instead of the ID for these types of scenarios. But I cannot find the right explanation.

Country Object in MFIles = Andorra

Customer Country From DB = Andorra

Resulting Customer Object "Primary Country" prop = NULL

-Jason

Parents
  • If it doesn't work directly by mapping the country value to the Country value list property, then I think this may require writing a small event handler than would do the linking between the objects: you would map the text value country name from the external database into a text property in M-Files and then your event handler would search for the Country object based on that text value and fill a value list property pointing to the Country object accordingly. The text property can be hidden from users via property definition permissions or metadata card configuration.

Reply
  • If it doesn't work directly by mapping the country value to the Country value list property, then I think this may require writing a small event handler than would do the linking between the objects: you would map the text value country name from the external database into a text property in M-Files and then your event handler would search for the Country object based on that text value and fill a value list property pointing to the Country object accordingly. The text property can be hidden from users via property definition permissions or metadata card configuration.

Children
No Data