cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Englishweb
Post Patron
Post Patron

collection from an edit form and save to another datasource?

Hello

Is it possible to:

1 make a collection from an edit form and 

2 save the collection as a new record in a table (Excel) which is separate from the form's datasource?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Give it a try it will work. You said
"I have a form pulling data from a gallery (Gallery1.Selected). "
This means that whatever you select in the gallery, same information would appear on the form. So the record on selected gallary1 would be same on the form.

Unless you want to edit the form after you have clicked the Gallery1. In that case a simple patch would do the work :
OnSelect of a Button Put:

Patch('[dbo].[YourNewDataSource]',Defaults('[dbo].[ YourNewDataSource]'),
{FirstName: DatacardValue1.Text,
Receipient:DatacardValue2.Text,
FullName:DatacardValue3.Text})


View solution in original post

6 REPLIES 6
PowerAddict
Super User II
Super User II

So the short answer to both of your questions is yes. However, can you expand a bit more on your 1st question?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Hi Hardit

Thanks for your reply. 

I have a form pulling data from a gallery (Gallery1.Selected).  The datasource of the gallery is an Excel Table1.

The form has 5 datacards from the Gallery with text inputs.

I am trying to make a collection from the 5 datacard inputs so that I can save them to a new Excel Table2 as separate rows, (instead of submitting the form to the original datasource).

I hope this makes sense!!

Please follow this:
2. Insert an Icon1 or button1 into YourGallery1
Set the Onselect of the Icon1 to; Select(Parent);Set(CollectionName,ThisItem) . This will create a variable of the item clicked

3. Insert a another button2 on your screen not in the gallery and put the onselect to the following Patch:
Patch('[dbo].[DataSource]',Defaults('[dbo].[ DataSource]'),
{FirstName: CollectionName. FirstName,
ReceipientName: CollectionName.ReceipientName,
FullName: CollectionName.FullName,
EntryDate: CollectionName.EntryDate})

Note; Point 2 above would create the collection1 while point 3 would insert the created items in the collection into your dataSource

Kindly change the datasource and column names to yours.


If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution

Hello @eka24 

I'm sorry your solution doesn't work for me. The form datasource is not the same as gallery1. I'm trying to collect and patch the form data to a new datasource (not the gallery1 datasource).

Give it a try it will work. You said
"I have a form pulling data from a gallery (Gallery1.Selected). "
This means that whatever you select in the gallery, same information would appear on the form. So the record on selected gallary1 would be same on the form.

Unless you want to edit the form after you have clicked the Gallery1. In that case a simple patch would do the work :
OnSelect of a Button Put:

Patch('[dbo].[YourNewDataSource]',Defaults('[dbo].[ YourNewDataSource]'),
{FirstName: DatacardValue1.Text,
Receipient:DatacardValue2.Text,
FullName:DatacardValue3.Text})


View solution in original post

Thank you for your support and patience. It worked!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (80,657)