Lookup - ValueDisplayMember column not found in the lookup's datastructure - multiple fields

What version of Origam are you using - I’m on 2025.5.2.3862

I was trying to create Lookup with multiple fields in ValueDisplayMember. See images:

I was expecting it will work as DefaultLookup on entity field - it works as expected on Screen and I also expected it will work in Report same way - I’ve a Datastrucure with Entity, where AllFields is false and fields are added manually like this:


Thare is one field, which is using lookup defined above. The Datastructure field is set like this:

Instead I’ve got an error, the FinalColumn shows error, that field is not in the Lookup’s Datastructure.

Running the report shows similar error.

{"ClassName":"System.InvalidOperationException","Message":"ValueDisplayMember column not found in the lookup's datastructure. Lookup: FleetVehicle_Trucks","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":"   at Origam.Schema.EntityModel.DataStructureColumn.get_LookedUpDisplayColumn() in D:\\a\\1\\s\\backend\\Origam.Schema.EntityModel\\Data Structure\\DataStructureColumn.cs:line 251\r\n   at Origam.DA.Service.DatasetGenerator.CreateDataSet(DataStructure ds, Boolean includeCalculatedColumns, DataStructureDefaultSet defaultSet, CultureInfo culture, Boolean forceBuildFromDatastructure) in D:\\a\\1\\s\\backend\\Origam.DA.Service\\Generators\\DatasetGenerator.cs:line 338\r\n   at Origam.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery query, IPrincipal principal, DataSet dataset, String transactionId) in D:\\a\\1\\s\\backend\\Origam.DA.Service\\AbstractSqlDataService.cs:line 323\r\n   at Origam.Workflow.DataServiceAgent.LoadData(DataStructureQuery query, DataSet data) in D:\\a\\1\\s\\backend\\Origam.Workflow\\Service Agents\\DataServiceAgent.cs:line 85\r\n   at Origam.Workflow.DataServiceAgent.Run() in D:\\a\\1\\s\\backend\\Origam.Workflow\\Service Agents\\DataServiceAgent.cs:line 421\r\n   at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId, String transactionId, QueryParameterCollection parameters, DataSet currentData, String entity, String columnName) in D:\\a\\1\\s\\backend\\Origam.Workbench.Services\\CoreServices\\DataService.cs:line 92\r\n   at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId, String transactionId, QueryParameterCollection parameters) in D:\\a\\1\\s\\backend\\Origam.Workbench.Services\\CoreServices\\DataService.cs:line 59\r\n   at Origam.BI.ReportHelper.LoadOrUseReportData(AbstractDataReport report, IXmlContainer data, Hashtable parameters, String dbTransaction) in D:\\a\\1\\s\\backend\\Origam.BI\\ReportHelper.cs:line 252\r\n   at Origam.BI.CrystalReports.CrystalReportService.GetReport(Guid reportId, IXmlContainer data, String format, Hashtable parameters, String dbTransaction) in D:\\a\\1\\s\\backend\\Origam.BI.CrystalReports\\CrystalReportService.cs:line 59\r\n   at Origam.Workflow.ReportServiceAgent.GetReport(Guid reportId, IXmlContainer data, String format, Hashtable parameters) in D:\\a\\1\\s\\backend\\Origam.Workflow\\Service Agents\\ReportServiceAgent.cs:line 53\r\n   at Origam.Workflow.ReportServiceAgent.Run() in D:\\a\\1\\s\\backend\\Origam.Workflow\\Service Agents\\ReportServiceAgent.cs:line 103\r\n   at Origam.Workbench.Services.CoreServices.ReportService.GetReport(Guid reportId, XmlDocument data, String format, Hashtable parameters, String transactionId) in D:\\a\\1\\s\\backend\\Origam.Workbench.Services\\CoreServices\\ReportService.cs:line 51\r\n   at Origam.Server.Controller.ReportController.HandleReport(ReportRequest reportRequest, String reportName) in D:\\a\\1\\s\\backend\\Origam.Server\\Controller\\ReportController.cs:line 152\r\n   at Origam.Server.Controller.ReportController.Get(Guid reportRequestId) in D:\\a\\1\\s\\backend\\Origam.Server\\Controller\\ReportController.cs:line 89","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2146233079,"Source":"Origam.Schema.EntityModel","WatsonBuckets":null}

As far as I can see, you don’t have the DefaultLookup filled in the field properties, but have UseLookupValue=True. Try adding the correct lookup.

Or if the referenced field refFleetVehicleId is already set up with a lookup in the entity, set UseLookupValue=False.

I’ve tried both. The DefaultLoookup is specified in the Entity field.
When I set DefaultLookup on Datastructure field I get same error as I reported. When I set UseLookupValue=false (DefaultLookup in Datastructure field is not filled, only in the Entity field is filled), there is GUID value in the dataset.

When I remove one of the field from Lookup’s ValueDisplayMember it works well. The problem is only with multiple fields in the Lookup’s ValueDisplayMember.

@zcapkova please any update with this issue?
thank you.

What kind of report are the data used in? In what format do you export? I have only ever used multiple values in lookup in Origam screens so I am not sure how they are exported.

I can think of a roundabout way if you use a concatenated field that would connect two lookup strings, one returning the ReferenceCode and the other the LicenseNumber.

Can you check how the lookup value is delivered for the screen?

It’s data set for crystal reports. It’s exported as PDF file.
Definition for a field in a screen section:


A this is how it looks like in UI form (ReferenceCode is R9 and LicenseNumber is the rest of the string):
image
It works in screens and XSLT transformations but not in reports. There is no limitation in documentation mentioned, so I think it should work otherwise it’s bug :slight_smile:

From lookup documentation:

From what you show here, you have two different cases. The first one is a lookup field in a data structure named LicenseNumber that is based on refFleetVehicleId and this one fails when you use a lookup with more that one field in the ValueDisplayMember attribute. The second case, the one that you use in the screen is based on the database field refFleetVehicleId and the lookup is set only in the screen section.

From my testing using a lookup with multiple values in ValueDisplayMember works when set up as a lookup for a screen section field and when called in a transformation with function AS:LookupValue. It fails when creating a lookup field in a data structure and when such a field is in a data structure used for a load step in a workflow.

@tvavrda @washi Is this considered a feature or is it a bug?

I consider it as a feature.

The recommended solution is to create a lookup that will return both values as just one string.

I don’t agree with @washi. From my point of view it is a bug, because there is no limitation mentioned in the documentation. The documentation says, you can have one or multiple column in ValueDisplayMember

Sure but then it is the omission in the documentation and we need to fix the documentation.

@washi Maybe it would be better to include it in the idea plan for future releases, rather than changing the documentation :slightly_smiling_face:

According to my memory and the following remark in the code it should actually work: