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

 

 

v-siky-msft
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
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

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (4,193)