cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Create multiple new records in SharePoint at one time

 

I am working on an app that allows workers to sign up for specific slots on a specific date.  I have a SharePoint list that stores all of the data.  I want the person creating the slots to be able to designate how many slots they want to create at one time.  So if the person entered 12 it would create 12 slots with the exact same data in the columns identified because later on they will be able to edit those with more specific information.  I have it set that it is able to create one new record at a time but again I want them to be able to create multiple records at one time.  I have researched how to do for loops using powerapps using collections but I am unable to figure out again to limit the number of rows in the collection to the number the staff identify.  Any help would be appreciated.  

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

So this is what I put in the OnSelected for the submit button:

 

orAll(
FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], If(IsBlank(TextInput1.Text), 1, Value(TextInput1.Text))),
Patch(
'Red Team Sign up',
Defaults('Red Team Sign up')
{
Status: StatusComboBox.Selected,
Date: DatePicker1.SelectedDate,
'Half day time period': HalfDayTimePeriodComboBox.Selected
}
)
)

 

I am getting an error Unexpected Characters.  The formula contains 'ParenClose' where 'CurlyOpen' is expected.  Any thoughts?

View solution in original post

4 REPLIES 4
Super User III
Super User III

Hi @JSawyer ,

 

Unfortunately, there are no loops in Power Apps. However, we have a great workaround for everything. follow the below article to implement looping in Power Apps.

https://www.dynamicpeople.nl/en/news/while-loop-powerapps/

 

Please don't hesitate to ask me back if you see it is not clear to you.

 

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

 

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider  Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
Community Support
Community Support

Hi @JSawyer ,

Do you want to create multiple Slot records once time based on the entered number within the TextInput Box?

 

Based on the needs that you mentioned, I think the ForAll function and Patch function could achieve your needs. Please consider take a try with the following workaround:

Set the OnSelect property of the "Submit" button to following:

ForAll(
       FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25, ...., 98, 99, 100], If(IsBlank(SlotNumberTextInput.Text), 1, Value(SlotNumberTextInput.Text))),
       Patch(
             'Your SP List',
             Defaults('Your SP List'),
              {
                Title: "Slot Create For " & User().FullName,
                Status: StatusComboBox.Selected,
                Date: DatePicker1.SelectedDate,
                'Half day time period': HalfDayTimePeriodComboBox.Selected
              }
       )
)

Note: The SubmitForm function could not achieve your needs.

 

Please consider take a try with above solution, check if the issue is solved.

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

So this is what I put in the OnSelected for the submit button:

 

orAll(
FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25], If(IsBlank(TextInput1.Text), 1, Value(TextInput1.Text))),
Patch(
'Red Team Sign up',
Defaults('Red Team Sign up')
{
Status: StatusComboBox.Selected,
Date: DatePicker1.SelectedDate,
'Half day time period': HalfDayTimePeriodComboBox.Selected
}
)
)

 

I am getting an error Unexpected Characters.  The formula contains 'ParenClose' where 'CurlyOpen' is expected.  Any thoughts?

View solution in original post

Hi @JSawyer ,

 

Try this it is just formatting issue and syntax issue:

ForAll(
    FirstN(
        [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25
        ],
        If(
            IsBlank(TextInput9.Text),
            1,
            Value(TextInput9.Text)
        )
    ),
    Patch(
        'Employee Details',
        Defaults('Employee Details'),
        {Title: "Sample"}
    )
)

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider  Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

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 (32,446)