cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sdedic
Helper I
Helper I

Transfer data between apps with Launch function

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:

sdedic_2-1660569842893.pngsdedic_0-1660569370736.png

 

 

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.

sdedic_1-1660569721632.png

 

Any help or advice is much appreciated.

Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

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"))

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

5 REPLIES 5
Rhk
Helper II
Helper II

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.

sdedic
Helper I
Helper I

Did anyone have luck with this? 

BCBuizer
Super User
Super User

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"))

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
sdedic
Helper I
Helper I

Hi @BCBuizer,

 

this worked! Thank you so much!

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

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

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,684)