cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davidtheilman
Frequent Visitor

Populate a Datacard from one Screen to another Datacard on another Screen

Hello:

 

I am creating a Sales Proposal PowerApp that has many choices of products, each product has it's own screen

 

"Screen 1" is just customer information 

"Screen 2 through 10" are different products that the sales rep can choose from, They can choose 1 product or all 10

 

Each product screen asks for the customer information and I do not want the sales rep to have to fill it out again each time they pick another product for the proposal. Each screen represents a different SharePoint List

 

Screen 1

ScreenA.png

Screen 2 through 10

Screen2.png

 

Once Screen 1 is populated and no matter which screen the sales rep chooses, I want the customer information pre-populated from Screen 1

 

PATree.png

I have tried this, however its not working

If(editform2.mode=FormMode.New,LookUp(CustomerName_DataCard7,ItemNumber=DataCardValue406.Text,CutomerName))

 

Thanks for the help in advance!

 

 

 

 

 

 

11 REPLIES 11
vribeiro
Frequent Visitor

What if you try to create global variables with the Screen 1 objects values?

 

For example, on the event below

vribeiro_0-1617107618668.png

 

 

Try to set the values of the objects. like

Set(DCV406,vribeiro_1-1617107683849.png.text)...

 

Then on the other screens, you populate where you want with DCV406.text...

RandyHayes
Super User III
Super User III

@davidtheilman 

Set the Default property of DataCardValue44 (and any other ones you need) to the following formula:

Coalesce(Parent.Default,  Form8.Updates.CutomerName)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@vribeiro 

 

I am halfway there, thanks!

 

After I created the variable, I then when to the Screen - Datacard and for Default I added this

default.png

 

My value in the screen is now "false"

 

CN.png

The source has data

 

CN1.png

 

What am I doing wrong on the when entering Default=DCV406

 

Thank You Again!

 

 

RandyHayes
Super User III
Super User III

@davidtheilman 

You cannot assign values like that in PowerApps.

Please change the formula on the TextInput control to:

   Coalesce(Parent.Default,  Form8.Updates.CutomerName)

 

Make sure you have not changed the Default property on the DataCard.  It should still be ThisItem.yourFieldName

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

David, just missed the UpdateContext, take a look i just create a simple example:

 

Set the variable on the On Start as you did

vribeiro_0-1617112159072.png

On the control that you are using to navigate to the other screens, set the UpdateContext

vribeiro_1-1617112183726.png

And also on the screen that you navigate in, set on the OnVisble another UpdateContext 

 

vribeiro_2-1617112205790.png

 

RandyHayes
Super User III
Super User III

@vribeiro 

You are mixing context and global variables in your examples.  They are not connected.

The solution is quite simple:

     Coalesce(Parent.Default,  Form8.Updates.CutomerName)

There is no need for variables as the first form already has the values needed...just reference it!

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Got it, it works for me in this way, didn't know about this Coalesce function! Thanks for that'll try to start using this approach also.

 

Always learning 😃

RandyHayes
Super User III
Super User III

@vribeiro 

That's the spirit...keep on learning! 😁

Yes, learn the Coalesce function - it is one of the most powerful and useful functions in PowerApps.  Pus it will save you a lot of typing time...

 

If(IsBlank(myControl.Text), If(IsBlank(myOtherControl.Text), "Something"), myOtherControl.Text), myControl.Text)

is replaced with:

Coalesce(myControl.Text, myOtherControl.Text, "Something")

 

First argument that is NOT blank in a Coalesce will be used.

Just make sure you are matching types.

ex.   Coalesce("Text", 2) will not work.  Coalesce("Text", "2") would (although it would simply return the first - but the concept here is coalesce the same types)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Is this correct? I am getting an error

 

data1.png

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,312)