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

Looking for the most efficient way to create/save new record

Data is housed in an on-prem SQL db.  Each record (in Table1) has over 250 fields that are all required.  I believe a collection is the correct route for saving records (using the collect method).  What's the best way to create a record, without having to hard code all 250+ data fields?

 

2 REPLIES 2
Memorable Member
Memorable Member

I know in Sharepoint I just do ClearCollect(Alldata,datasource)  this returns all data in the list plus all columns.  Some things to think about though.

 

1.  I think there is a Column limit that can be returned.  Not sure how many but I think 250 may not be in that.

2. Collections atre non delegable so you may have issues with how much data you want to return.  Max would be 2000 records. 

 

 

Community Support
Community Support

Hi @KUNGFUPANDA559 ,

 

Have you ever used Edit Form?  Edit Form may be the best ways to create records without having to hard code all 250 fields. Do you think it works well for you?

Patch function and Collect function are also good ways, and Collect is better in performance. Though you need to add Textinput box manually to pass values to Data source.

 

You can create a Edit Form, and use SubmitForm function to create a record.

  1. Create a Edit Form
  2. Choose edit fields, and set Default Mode as New
  3. Create a submit button, set Onselect property as below.
SubmitForm(Form1); NewForm(Form1)

Annotation 2019-09-02 124312.png

You also can use Patch/Collect function and Textinput boxes to create new record as below,  which is a little more complicated, though, because you might need to create a lots of boxes manually.

Patch(Date Source,  Defaults(Data Source), {Field1: Textinput1.Text, Field2: Textinput2.Text, … })
Collect(Data Source, {Field1: Textinput1.Text, Field2: Textinput2.Text, … })

Best regards,

Sik

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (66,683)