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
Anonymous
Not applicable

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
Super User

@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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@Anonymous 

 

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
Super User

@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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

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
Super User

@Anonymous 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

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
Super User

@Anonymous 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,000)