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:
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:
Now, for my EditForm, I'm setting its Item property to the following:
But I'm getting an error saying "Invalid formula. Expecting a value compatible with 'DataSource'.
Any idea what I am doing wrong?
Solved! Go to Solution.
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:
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/
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:
Then in your second app, set your EditForm item to:
I hope that is helpful for you.
@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:
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.
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.
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.
**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?
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.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.