Added new field in the CDS view which is mapped in OData, but there is no data displayed for the new field in UI application Smart table
Sometimes we face an issue like, we add a new field(for e.g. Status) in the CDS view which is mapped to an entity(for e.g. CustomerDataEntity) in OData. We import the same field to the properties of entity. But when we check in the UI smart table, there will be no data getting displayed fir this field.
When we see this issue, what comes to our mind is there is some issue in the CDS view. But when we run the CDS view, we will see the correct data output for the CDS view including field ‘Status’.
Then what might be the issue? Is there some issue in “GET_ENTITYSET” method for getting the field data? No..
The issue is here : After adding the field ‘Status’ in the properties of the entity, most of the times we forget to ‘Generate Mapping’ for the new property added.
We can see in the below screenshot that the Element value is empty for the property Status.
In the UI application, we can see the data is null for the Status.
How to resolve the issue: Click on ‘Generate Mapping’ and then save and ‘Generate Runtime Objects’ for the OData. Now we can see the Element value gets filled as in the below screenshot.
Now we can run our UI application and see the data for the Status is appearing as expected in the smart table.
Conclusion: We should make sure that we generate mapping for the new field added to the properties of the entity, so that the data for the new field appears in the application.