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

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. 🙂

 

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. 😉

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
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.

View solution in original post

2 REPLIES 2
Highlighted
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.

View solution in original post

Highlighted
Community Support
Community Support

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,699)