Hi,
I am trying to find a way how to populate a form in one app with the data from another app.
So, inside the first app when user selects an item from a gallery, they should be transferred to the second app and presented with the form populated with data of that particular item selected from the gallery.
I am trying to accomplish this with the Launch fucntion, but the problem is that Param attribute inside Launch function requires records of text values only. When I provide text value to the Param attribute as shown below...
Launch("https://apps.powerapps.com/play/xxx-xxx-xxx-xxx-xxx?tenantId=xxx-xxx-xxx-xxx-xxx", {varVaue1: galApp1.Selected.Name}, Replace)
...and transfer it to the second app, I can't use it as the Item of the form in the other app. It shows following error:
I also tried to Filter data source of the form:
Filter(Source1, Name = Param("varValue1"))
It didn't work as well. Form in New mode shows blank fields, in Edit mode it won't load.
Any help or advice is much appreciated.
Thank you!
Solved! Go to Solution.
Hi @sdedic ,
The DataSource property of a form control just defines where the possible items to be displayed/edites are coming from to set the right fields. It's actually in the Item property where you set the item to be displayed. You were almost there when setting the Item property of the form in the second app, but instead of providing the item you provided a reference to the item. To get the item itself, you need to use the LookUp function:
Form2.Item = LookUp(Source1, Name = Param("varValue1"))
Before launching, set a variable with varValue1
Call the variable in the launch function
Launch("https://apps.powerapps.com/play/xxx-xxx-xxx-xxx-xxx?tenantId=xxx-xxx-xxx-xxx-xxx"& VarValue1)
I have given varvalue1 at the end but you can pass it anywhere you want it to be.
Hi @Rhk,
Thank you for the suggestion. I've tried what you said but I am not sure how can I utilize the variable inside my second app?
Let me try to make things clear what I want to achieve. In short, I would like to do the same thing as if I had two screens instead of two different apps. I want to select an item from gallery on one screen, navigate to the second screen and see the form populated with the selected item.
So, I want this variable to have the value of a selected item from the gallery inside the first app. I set it like this:
Set(varValue1, galApp1.Selected)
After the user selects an item it has to be transferred to the second app and the form in that second app should be populated with the selected item data. So, the gallery OnSelect property has the following formula:
Launch("https://apps.powerapps.com/play/xxx?tenantId=xxx" & varValue1)
Here I receive an error because it expects a different data type (text, number, date...), and not a whole record.
Inside the second app Item of the form should be set to:
varValue1
Since the varValue1 doesn't exist in the second app I am getting 'Name isn't valid' error.
Do you have an idea how to manage this?
Thank you.
Did anyone have luck with this?
Hi @sdedic ,
The DataSource property of a form control just defines where the possible items to be displayed/edites are coming from to set the right fields. It's actually in the Item property where you set the item to be displayed. You were almost there when setting the Item property of the form in the second app, but instead of providing the item you provided a reference to the item. To get the item itself, you need to use the LookUp function:
Form2.Item = LookUp(Source1, Name = Param("varValue1"))
User | Count |
---|---|
252 | |
126 | |
104 | |
49 | |
49 |