cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KUNGFUPANDA559
Level: Powered On

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
Level 10

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

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
Level 10

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

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 176 members 6,021 guests
Please welcome our newest community members: