web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get or Pass column/att...
Power Apps
Answered

Get or Pass column/attribute value from Model Drive App to Canvas App

(0) ShareShare
ReportReport
Posted on by 1,115

I would like to pass the value of a Dataverse table column from the Model Driven App to the Canvas Page. The Canvas Page is a Modal window created to upload several documents as attachments to the SharePoint library.

 

RameshMukka_0-1704785423430.png

 

 

I would like to show or hide a few attachment controls on the canvas page based on the column value in the Model Driven Main Form page.

 

Here is the JavaScript I am using for the same.

 

function openCustomPageDialog(primaryControl, firstSelectedItemId, selectedEntityTypeName)
{
 // Centered Dialog
	var formContext = primaryControl;
 var pageInput = {
 pageType: "custom",
 name: "new_payerdocumentpage_69f77",
 entityName: selectedEntityTypeName, // "sample_review"
 recordId: firstSelectedItemId, // "{087AA308-B321-E811-A845-000D3A33A3AC}"
		param_requestId: formContext.getAttribute("new_requestid").getValue()
 };
 var navigationOptions = {
 target: 2,
 position: 1,
	height: {
	 value: 500,
	 unit: "px"
	},
	width: {
	 value: 500,
	 unit: "%"
	},
	title: "Upload Documents"
 };
 Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
 function () {
 // Refresh the main form when the dialog is closed
 primaryControl.data.refresh();
 }
 ).catch (
 function (error) {
 // Handle error
 }
 );
}

 

I am trying to read the value of the parameter param_requestId in Canvas Page OnStart, but the value doesn't show up. I don't understand where am doing wrong.

 

Set(
 gbl_RequestId,
 Param("param_requestId")
);

 Thanks,

Ramesh

I have the same question (0)
  • Verified answer
    Parvez Ghumra Profile Picture
    1,579 Moderator on at

    @RameshMukka  According to the docs here, you can't pass in additional data to Xrm.Navigation.navigateTo (other than entityName and recordId). So I think you're easiest option is, to save changes to the record, before launching the Custom Page. This way when you retrieve the record in your Custom Page logic, it will contain the updated data: https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto#custom-page

     

    The alternative is to use one of the available parameters to pass in multiple values as a JSON string. This approach is demonstrated here: https://xrmtricks.com/2021/10/25/how-to-pass-an-object-from-a-model-driven-to-a-custom-page/

  • Jonathan Manrique Profile Picture
    2,687 on at

    Hi @RameshMukka 

     

    Hello, on this page of the documentation you have how to do it.

     

    https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples

     

    App.OnStart=Set(RecordItem, 
     If(IsBlank(Param("recordId")),
     First(<entity>),
     LookUp(<entity>, <entityIdField> = GUID(Param("recordId"))))
     )

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    You can accept more than one post as a solution

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard