Hi, you can achieve this by:
type
field values to these view GUIDs in your JavaScript code.type
field on the portal form.viewid
parameter based on the type
field’s value.type
values.type
is empty or doesn’t match any mapped view (use a default view).You can achieve this by using JavaScript to:
First, identify the GUIDs of the views associated with the Work Order lookup. You can find these in the Dataverse table view settings.
You’ll need to inject JavaScript into the page using a Web Page Web File or directly in the Web Page’s Custom JavaScript section.
Here’s a sample script:
$(document).ready(function () {
// Map Type values to View GUIDs
var viewMap = {
"Installation": "GUID_FOR_INSTALLATION_VIEW",
"Maintenance": "GUID_FOR_MAINTENANCE_VIEW",
"Inspection": "GUID_FOR_INSPECTION_VIEW"
};
// Watch for changes in the Type field
$("#type_field_id").change(function () {
var selectedType = $(this).val();
var viewId = viewMap[selectedType];
if (viewId) {
// Set the view for the Work Order lookup
$("#workorder_lookup_field_id").attr("data-viewid", viewId);
}
});
});
Replace
#type_field_id
and#workorder_lookup_field_id
with the actual DOM IDs of your fields. You can inspect these using browser dev tools.
🏷️ Tag me if you have any further questions or if the issue persists.
✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
❤️ Give it a Like if you found the approach useful in any way.
Fubar
62
Super User 2025 Season 2
Lucas001
48
Super User 2025 Season 2
KevinGador
44
Super User 2025 Season 2