cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

How to populate a field on a newform with data from a detailform where the addcontrol originated?

I am trying to make a powerapp based on Dynamics 365 Sales-data. I started with an app based on the account dataset. On the Account DetailScreen I am trying to make an add-control to create a new opportunity for the account. I want to autopopulate the accountfield in the opportunity with the account that was shown on the Account DetailScreen, but am not succeeding.

 

So far my formula is as follows

NewForm(NewOpportunityForm) ; Navigate(EditOpportunityScreen , ScreenTransition.None , { _parentaccountid_value : accountid } )

 

The NewForm and Navigate parts of the formula work. The update field part does not. Adding Account. or ThisItem. before the column name accountid does not work eather.

 

Anny suggestions how to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

Hello Rebekka,

what you need to do is to change the Default property of the account field datacard (or the Default property of its main control, which should be a text input or a dropdown) of the NewOpportunityForm.  You may need to unlock the datacard in order to be able to edit its properties or those of its controls.

 

The Default property will need to be set in such a way as to pick up the accountid from the AccountDetail screen.  How this is done depends on how you select the account in the AccountDetail screen and what context variables contain this.  Is it accountid?

 

If so, then you correctly set the _parentaccountid_value to account id as you have done.  The Default property then should simply be set to _parentaccountid_value

 

Please let me know if this works, and if it has not, then additional details /screenshots to be able to help you.

View solution in original post

4 REPLIES 4
Highlighted
Community Champion
Community Champion

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

Hello Rebekka,

what you need to do is to change the Default property of the account field datacard (or the Default property of its main control, which should be a text input or a dropdown) of the NewOpportunityForm.  You may need to unlock the datacard in order to be able to edit its properties or those of its controls.

 

The Default property will need to be set in such a way as to pick up the accountid from the AccountDetail screen.  How this is done depends on how you select the account in the AccountDetail screen and what context variables contain this.  Is it accountid?

 

If so, then you correctly set the _parentaccountid_value to account id as you have done.  The Default property then should simply be set to _parentaccountid_value

 

Please let me know if this works, and if it has not, then additional details /screenshots to be able to help you.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

I found out what the problem was. The addcontrol was not properly set to the AccountViewForm. Instead it was set on the screen. So it missed context. When I moved it to a card on the form problem was solved.

Highlighted
Community Champion
Community Champion

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

OK, glad you got it solved

Anonymous
Not applicable

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

I think there is a bug somewhere, because it stopped working all of a sudden. Weird.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,349)