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.
Solved! Go to Solution.
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?
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.
Proud to be a Super User!
Regards,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.
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?
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.
Proud to be a Super User!
Regards,User | Count |
---|---|
183 | |
124 | |
88 | |
45 | |
43 |
User | Count |
---|---|
247 | |
156 | |
127 | |
78 | |
73 |