cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
neill_long
Resolver III
Resolver III

Order form to be able to order multiple items

I am trying to create an app that allows our staff to order stationery.  The app is connected to a sharepoint list.  Just now the user can complete an order form for 1 item then submit, but there are likely to be times when they want to order more than one item at a time.

 

Is there a way that this can be done?  I was thinking they press a button to add a new line but i really have no idea what i'm doing and any advice would be great?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @neill_long,

 

Do you want to add multiple orders within your app at the same time?

 

I agree with @Drrickryp's thought almost, I think the following video would help in your scenario:

https://www.youtube.com/watch?v=xgznk4XlPCo

 

You could consider take a try to create a Label control or TextInput control (or other controls) for each column in your SP list within a Gallery control (instead of using Edit form control).

 

I have created a SP list on my side, the data structure as below:10.JPG

I have made a test on my side, please take a try with the following workaround:11.JPG

 

12.JPG

 

Set the OnVisible property of the first screen of my app to following formula:

ClearCollect(OrderCount,1)

Set the Items property of the Gallery control (Gallery1) to following:

OrderCount

Set the OnSelect property of the "New Order" button to following formula:

Collect(OrderCount,CountRows(OrderCount)+1)

Set the OnSelect property of the "Upload" button to following formula:

ForAll(
Gallery1.AllItems,
Patch(
'20180918_case9',
Defaults('20180918_case9'),
{
Title:"PowerApps Test",
Product_x0020_Name:TextInput1.Text,
Price:Value(TextInput2.Text),
Executor:TextInput3.Text
}
)
)

Note: The '20180918_case9' represents the SP list data source within my app.

 

On your side, you should type the following formula:

ForAll(
Gallery1.AllItems,
Patch(
'YourSPList',
Defaults('YourSPList'),
{
Title:"PowerApps Test",
Column1:TextInput1.Text,
Column2:TextInput2.Text,
Column3:TextInput3.Text,
...
}
)
)

 

The GIF screenshot as below:Test1.gif

 

 

 

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Kris

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.

View solution in original post

3 REPLIES 3
Drrickryp
Super User
Super User

Hi @neill_long,

 

It sounds like you would like something like repeating tables in your gallery.  This is a feature that was popular in Infopath forms.  Shane Young has a great video explaining how to do this.  Please check out https://www.youtube.com/watch?v=xgznk4XlPCo.  There are some other ways to do this using Forms but I think Shane's approach is the best.  

v-xida-msft
Community Support
Community Support

Hi @neill_long,

 

Do you want to add multiple orders within your app at the same time?

 

I agree with @Drrickryp's thought almost, I think the following video would help in your scenario:

https://www.youtube.com/watch?v=xgznk4XlPCo

 

You could consider take a try to create a Label control or TextInput control (or other controls) for each column in your SP list within a Gallery control (instead of using Edit form control).

 

I have created a SP list on my side, the data structure as below:10.JPG

I have made a test on my side, please take a try with the following workaround:11.JPG

 

12.JPG

 

Set the OnVisible property of the first screen of my app to following formula:

ClearCollect(OrderCount,1)

Set the Items property of the Gallery control (Gallery1) to following:

OrderCount

Set the OnSelect property of the "New Order" button to following formula:

Collect(OrderCount,CountRows(OrderCount)+1)

Set the OnSelect property of the "Upload" button to following formula:

ForAll(
Gallery1.AllItems,
Patch(
'20180918_case9',
Defaults('20180918_case9'),
{
Title:"PowerApps Test",
Product_x0020_Name:TextInput1.Text,
Price:Value(TextInput2.Text),
Executor:TextInput3.Text
}
)
)

Note: The '20180918_case9' represents the SP list data source within my app.

 

On your side, you should type the following formula:

ForAll(
Gallery1.AllItems,
Patch(
'YourSPList',
Defaults('YourSPList'),
{
Title:"PowerApps Test",
Column1:TextInput1.Text,
Column2:TextInput2.Text,
Column3:TextInput3.Text,
...
}
)
)

 

The GIF screenshot as below:Test1.gif

 

 

 

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Kris

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.

Hi

 

I've had a go at the steps you outlined @v-xida-msft and i am half way there.

 

I am having difficulty with the Upload side of things.  I have amneded the details of the patch function to this:

 

ForAll(
   Gallery2.AllItems,
   Patch(
      'Testing',
       Defaults('Testing'),
       {
        Title:"PowerApps Test",
        Date_x0020_of_x0020_Request: DatePicker1.SelectedDate,
        StaffName: Dropdown2.Selected.Value,
Quantity: Value(TextInput7.Text),    
        Item: Dropdown1.Selected.Value,
       ...
       }
    )
)

The SP list is called Testing. 

 

 

I have changed the fields from textinput, one is a datepicker, two fields are dropdowns which get their items from the datasource 'Testing'.  Not sure if this makes any difference.  Do the fields have to be TextInput?

 

Capture.PNG

 

Here is a screenshot of the SP List:

 

Capture2.PNG

Any advice on where i may have gone wrong would be appreciated.

 

thanks

Alistair

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,243)