cancel
Showing results for 
Search instead for 
Did you mean: 

Create a repeating table in PowerApps

Hi everyone,

 

I am here to share some ideas on creating a repeating table in the form that is for the SharePoint List.

 

In PowerApps, there is a control called Data Table and the user cannot insert data in the table as it used for display purposes. In this case, the data table will not be the option but we can use Gallery to create a repeating table.

 

As Gallery can be located in the Custom Data Card, the Gallery can be inserted in the Data Card so that it is in the Form instead of a screen. Next, we will need to create a Table into the Gallery by using the Controls.

 

In a table, we need to let the user  add rows, Insert and remove/delete rows:

RemoveIf(Purposes.Fn = ThisItem.Fn)

 

For this formula, it used a RemoveIf to check if this record matches with the collection. 

 

InputBoxes:

 use the Patch function in the OnChange property: 

1. Add rows:

For this case, we will need to use the Collect function and we can use an Icon (+) and put it in the Data Card

In the "+" OnSelect properties: 

1.PNG

  • First, create a Collection called Purposes.
  • Next, the columns (Fn = Field name, Desc = Description, Pus = Purpose) and these columns will be blank ("").

2. Insert and remove/delete rows:

We need to use the following controls:

  1. InputBox: for the user to insert
  2. Label: for the column
  3. Icon (X): for the user to delete/remove the row

Example:

kevinyong_0-1595670196847.png

REMEMBER THESE CONTROLS MUST BE IN THE GALLERY!!!

 

"X" icon:

use the Remove function in the OnChange property:

 

patch(Purposes,'repeating table'.ThisItem,{Fn:'Field Name input'.Text}) patch(Purposes,'repeating table'.ThisItem,{Desc:'Desc input'.Text}) patch(Purposes,'repeating table'.ThisItem,{Pus:'Purpose input'.Text})

Field Name:

Description:

 Purposes:

 

 

After that, we will need to submit the records that have been inserted in the repeating table, it can be done by using a Button to submit. Before that, you will need to ensure that you have a place to store these records (it is better to create another SharePoint List)

 

Submit button:

In the OnSelect property:

1.PNG

  1. SubmitForm to submit the form
  2. ForAll used for all the records inserted in the 'Repeating Table' (which refers to the Gallery) and Patch into the SharePoint List that is used to store the records in the Repeating table. [As we will need to see all the inserted records, it can be done by using LastSubmit.ID which stores the ID number of the submitted items.

 

That's all for my sharing on creating a repeating table in the form. Do let me know if I made any mistakes.

 

Thank you very much

Status: New
Comments
Helper V

Updates on:

1.PNG

The formula is:

RemoveIf(Purposes.Fn = ThisItem.Fn)

For this formula, it used a RemoveIf to check if this record matches with the collection. 

 

kevinyong_0-1595675683045.png

In the InputBoxes OnChange Properties:

Patch the record that has been inserted in the row.

Field Name:

patch(Purposes,'repeating table'.ThisItem,{Fn:'Field Name input'.Text})

Description:

patch(Purposes,'repeating table'.ThisItem,{Desc:'Desc input'.Text})

 Purposes:

patch(Purposes,'repeating table'.ThisItem,{Pus:'Purpose input'.Text})

Advocate I

@kevinyong 

Hi,

 

To count the row(Number) I suggest the following formula

 

Number: Text(CountRows(Name of Collection) + 1)

 

Cheers,

Alaleh