cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WI-User-01
Level: Powered On

Using 2 Collections to Patch/Submit

I have an app I'm building and it asks the user a couple questions, then, click Next button.

The next screen asks them a lot more information, then, click Review button.

The Review screen shows them the details they've submitted from the first two screens, via a gallery.

 

Question: The data I'm collecting from screen1 is personal information, into RequestorInfo collection

The data I'm collecting from screen2 is computer related information into RequestDetails collection

I want screen2 to use/patch a combination of RequestorInfo and RequestDetails collections. I was hoping that I could simply reference both collections in my patch statement, but that doesn't seem to work, or else, I'm just doing it wrong. Smiley Happy

 

Thoughts to make this work? I'm not tied to 2 collections, just thought it'd be easier to do it this way, clearly I was wrong. Smiley Wink

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Using 2 Collections to Patch/Submit

You can use Patch statement to create new records in your data source by using this

 

Patch( Customers, Defaults( Customer ), { Name: “Contoso” } )

 

In your case, you prbably need to use forms on both the screens and then use something like this -

 

Patch (Requests, Defaults(Requests), RequestorInfoForm.Updates, RequestDetailsForm.Updates)

 

I hope this helps.

 

For more documentation visit this link - 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

 

Thanks

Vivek Bavishi / That API Guy

youtube.com/thatapiguy 


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
Super User
Super User

Re: Using 2 Collections to Patch/Submit

You can use Patch statement to create new records in your data source by using this

 

Patch( Customers, Defaults( Customer ), { Name: “Contoso” } )

 

In your case, you prbably need to use forms on both the screens and then use something like this -

 

Patch (Requests, Defaults(Requests), RequestorInfoForm.Updates, RequestDetailsForm.Updates)

 

I hope this helps.

 

For more documentation visit this link - 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

 

Thanks

Vivek Bavishi / That API Guy

youtube.com/thatapiguy 


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Community Support Team
Community Support Team

Re: Using 2 Collections to Patch/Submit

Hi @WI-User-01,

Can you share a bit more about your issue ?

Can you show me how to create a collection ?

Can you show me how to entry the values ?

 

If you entry the values by the custom controls in both screens, you can use formula like this :

I assume that RequestorInfo collection and RequestDetails collection have a same column named “Id.

 

Patch(RequestAll,Defaults(RequestAll),LookUp(RequestorInfo,Id=1),LookUp(RequestDetails,Id=1))

If you entry the values by the Edit Form in both screens, you can use formula like this :

 

Patch(RequestAll,Defaults(RequestAll),RequestorInfoForm.Updates,RequestDetailsForm.Updates)

 

Regards,

Eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 51 members 4,684 guests
Please welcome our newest community members: