cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simms7400
Post Prodigy
Post Prodigy

Pass Parameter from 1 app to another

Hi Folks -

 

I'm trying to pass a parameter from 1 PowerApp to another in order to populate an EditForm.

 

In my source app, I have an edit button that an end user will press which will launch the URL to the new app. I'm passing the paramter as such:

Launch("urlstring?DataElement=TargetBrowseGallery.Selected")

I'm usinf the ? to then suffix the parameter which is a select gallery item.

 

In my Target app, I'm setting a variable in the OnStart menu as such:

Set(PassedDataElement,Param("DataElement"))

Now, for my EditForm, I'm setting its Item property to the following:

PassedDataElement

But I'm getting an error saying "Invalid formula.  Expecting a value compatible with 'DataSource'.

 

Any idea what I am doing wrong?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

@simms7400 

So the common column as @LRVinNC suggested is "TargetID" and "Name"

 

So from your first app you will Launch with this parameter:

    Launch(yourUrlstring & "?DataElement=TargetBrowseGallery.Selected.TargetID

 

Then in your second app you will set your EditForm item to:

   Lookup(rdTargetChangeReq, Name=Param("DataElement"))

 

_____________________________________________________________________________________
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!

View solution in original post

16 REPLIES 16
LRVinNC
Super User
Super User

I think the problem may be what you are passing.  Try passing the ID of the record that you want loaded at startup.  Take a look at this blog post which describes a similar scenario:  https://itgroove.net/mmman/2017/10/17/how-to-pass-parameters-into-a-powerapp-2/

LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
RandyHayes
Super User
Super User

@simms7400 

Yes, you are trying to pass the entire record of the selected gallery item.  That's not going to work.

Instead consider passing the ID of the selected gallery item:

   DataElement=TargetBrowseGallery.Selected.ID

 

Then in your second app, set your EditForm item to:

   Lookup(yourDataSource, ID=PassedDataElement)

 

I hope that 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!

@RandyHayes  Thanks Randy!

 

So I updated my Param in my URL to be TargetID rather than "ID" you mentioned since "TargetID" is the column name in my data source of that gallery in my source application that corrresponds.

 

However, the source application as a different data source than the target app and thus, a different column name.

 

so I tried this in my target application but no luck:

LookUp(rdTargetChangeReq,Name=PassedDataElement)

How can I confirm the param is getting pass correctly?

What is the common key between the two data sources? Is it this ID field or is that only the system generated record ID on each data source?  You will need to determine what is in common between the two data sources that you can use to locate the record and then pass only that specific piece information.  Then you will likely need to do a lookup using that key value in the 2nd data source to get positioned to that row.

LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@LRVinNC @RandyHayes 

 

The source app is using "rdTarget" as the data source and "TargetID" as the column which is what my gallery displays.

 

My target app is using "rdTargetChangeReq" and the corresponding colun is "Name" containing the same infomration as "TargetID".

 

My thoughts are my param is being set correctly and thus, the variable i'm using returning NULL. 

@simms7400 

Like @LRVinNC mentioned - you need to determine what it is in the rdTargetChangeReq that you would need from the rdTarget record in order to lookup the proper item in the second data source.  That is what you would pass, and that is what you would put in your Lookup function in your second app.

_____________________________________________________________________________________
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 @LRVinNC 

 

hmmm, i'm still not following. How would I go about that to determine that since the data sources and columns are different?

@simms7400 

**scratching my head a bit**

If you have different data sources and columns between the two, then what exactly were you trying to pass in the first place?  You were trying to pass a record that is based on a data source that has a set of columns.  What exactly was the second app supposed to do with it?

 

Maybe we should go back to the start...what exactly is the second app about?  You said an EditForm.  An edit form for what?  The rdTargetChangeReq data source.  So, in the first app, they are seeing a list of items from an rdTarget - when they click on one, you want to go to the second form...for what?  To edit what?

If it's not the item in the rdTarget data source that you want to edit, then there has to be something the references the proper item in the rdTargetChangeReq...what is that?

 

_____________________________________________________________________________________
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!

Look at your data sources manually.  Look at the data in all the columns of the record in the first data source you are selecting.  Then find the record in the second data source you would want to display when the record in the first data source is selected.  Find the columns that contain common values between source1 and source2.   One (or more) of these will be the one/ones you will need to use in the app so it can do that same locating of the record for you automatically. Determine the column names associated with the field(s) and pass that data to use in the lookup in the 2nd app.

LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,047)