cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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

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

Community Support
Community Support

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

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (78,913)