When building apps using Microsoft Power Apps integrated with Microsoft Dynamics 365 Finance and Operations, a common requirement is to display:
- Item Name / Description on purchase lines
- Vendor Name on purchase order header
However, many developers quickly realize that:
These fields are not directly available on tables or exposed in standard data entities.
The Challenge
In Dynamics 365 F&O:
- Purchase line entities expose ItemId, but not the Item Name
- Purchase order header exposes Vendor Account, but not the Vendor Name
This becomes a limitation when building Power Apps, where you need user-friendly information instead of IDs.
The Right Approach: Use Computed Columns
To solve this, the recommended approach is to create computed fields (computed columns) in the data entity.
Instead of:
- Writing X++ logic using virtual fields
- Populating values in postLoad() (which impacts performance)
You should:
- Create a computed column
- Let SQL Server calculate the value
- Expose it directly to Power Apps via the data entity
Why Computed Columns Work Best for Power Apps
Computed columns:
- Are calculated at the database (SQL) level
- Provide better performance
- Support filtering and searching
- Are ideal for read scenarios like Power Apps
This makes them perfect for displaying:
- Vendor Name
- Item Name
Implementation Overview
- Extend the Data Entity
Use either:
- A standard data entity extension, or
- A custom data entity
2. Create a Computed Method
Create a static method that returns a SQL expression to
fetch:
- Vendor Name from Vendor table
- Item Name from Item table
3. Add Unmapped Field
In the data entity:
- Create
a new unmapped string field - Set:
- IsComputedField = Yes
- Reference your computed method
4. Extend Staging Table
Add the same field in the staging table with:
- Matching name
- Appropriate string size or EDT
Below is the sample code for Vendor name
public static server str getVendorName()
{
var orderAccount = SysComputedColumn::returnField(
tableStr(PurchApprovalHeaderEntity),
identifierstr(PurchTable),
fieldStr(PurchTable, OrderAccount)
);
// Correct vendor name lookup via DirPartyTable
return strFmt(“(SELECT TOP 1 P.Name ” +
” FROM VendTable V ” +
” JOIN DirPartyTable P ON V.Party = P.RecId ” +
” WHERE V.AccountNum = %1)”, OrderAccount);
}
Below is the sample code for Item name/description
public static server str getItemDescription()
{
// ItemId from the line (outer row)
str itemIdField = SysComputedColumn::returnField(
tableStr(PurchApprovalAttachedLineEntity),
identifierStr(PurchLine),
fieldStr(PurchLine, ItemId));
// Company filter omitted because PurchLine has no DataAreaId in your env.
// This relies on ItemId uniqueness or returns the first match.
return strFmt(
“COALESCE((” +
” SELECT TOP 1 I.NameAlias ” +
” FROM InventTable I WITH (READUNCOMMITTED) ” +
” WHERE I.ItemId = %1″ +
“), ”)”,
itemIdField);
}
Example Use Cases in Power Apps
Once the computed fields are added:
Purchase Order App
- Display:
- Vendor Account → Vendor Name
- Improves usability for business users
Purchase Line App
- Display:
- ItemId → Item Name
- Avoids confusion with technical IDs
Key Takeaway
If you’re building apps in Microsoft Power Apps on top of Microsoft Dynamics 365 Finance and Operations:
- Item Name and Vendor Name are not directly available fields
- Do not rely on virtual fields or postLoad() logic
- Use computed columns in data entities for a clean and high-performance solution
Conclusion
Computed columns provide a simple, scalable, and high-performance way to enrich your data entities for Power Apps.
By exposing Item Name and Vendor Name through computed fields, you ensure:
- Better user experience
- Faster data retrieval
- Cleaner architecture
Parag Chapre
Parag Chapre is a Microsoft MVP in the fields of Dynamics 365 Finance & Operations, Human Resources, and Power Platform, recognized for his outstanding contributions to the Microsoft Dynamics community.
With over 15 years of hands-on expertise in various Microsoft Dynamics 365 areas, Parag has designed and delivered complex, innovative solutions for customers across industries and geographies. He has also provided leadership and technical guidance to project teams, managed offshore and onshore resources, and worked closely with Microsoft Product teams. Parag is passionate about sharing his knowledge and insights through his personal website, blog posts, articles, and community events. He is a member of the Microsoft Biz Apps Community Advisory Board, a Dynamics 365 Human Resource Community star, a Dynamics 365 Community contributor, and a Dynamics 365 Community Spotlight honoree.




