cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevinyong
Helper V
Helper V

Cannot save repeating table data

Hi,

Currently, I am creating a SharePoint List Form and I had a problem on passing the data in the repeating table.

I created the repeating table that is in a SharePoint List Form and it is in a DataCard 

As the formula below is the submit form and I would like to collect all the data that has been inserted in the repeating table.

unnamed.png

When the form is submitted, it does not transfer all the item that has been inserted in the repeating table into the SharePoint List 

unnamed (1).png

 

Thank you

21 REPLIES 21
v-bofeng-msft
Community Support
Community Support

Hi @kevinyong :

Could you tell me :

What is the 'repeating table'?A gallery?

What are 'Field name input','Desc input','purpose input'?Are they text input controls?

Do you want to add records that in 'repeating table'.AllItems  to the SharePoint list?

I assume 'repeating table' is a gallery,'Field name input','Desc input','purpose input'……are controls in this gallery.

The key is to directly call the name of the field of the gallery's data source  instead of the gallery's controls.

If the problem is not resolved, could you provide me with more details?

Best Regards,

Bof

 

Hi @v-bofeng-msft,

Thank you for your reply,

 

The 'repeating table' is a gallery which is in a Data Card and the data card that contains the repeating table is in a SharePoint List Form.

The 'Purpose of data extraction from HR Systems' is the List that I wanted the data in the repeating table to be transferred to.

 

The 'Purposes' is the collection that I created.

 

In the repeating table, I also created a "+" icon

image002 (1).png

there is 3 text box for the user to input. The inputs are textbox in the 'repeating table' and all these inputs had assigned a default value:

- Field Name input: Fn

- Desc input: Desc

- Purpose input: Prs

 

As now, the formula is in a Submit button which is allocated in a custom data card.

The formula that I set in the button, it is to submit the form first and then transfer all the data in the repeating table to another list 'Purpose of data extraction from HR Systems'

image001 (1).png

As you can see, I used ForAll() first, then Collect(). When it runs, it does submit the form and transfer the ID only.

 

I tried to add Patch(), but it showed an error and said it was invalid.

Hi @kevinyong :

According to your description, do you want to write the data in 'repeating table' to 'Purpose of data extraction from HR Systems'?

Firstly,I want to explain why it can not be updated.

The point is :

The three controls of Field Name input, Desc input, and Purpose input are controls in the gallery, but their values are not included in gallery.AllItems. (You can create a collection to check the data and data structure of gallery.AllItems)

 

ClearCollect(thecollection,'repeating table'.AllItems)

 

Secondly,my suggestion is that you need to add three fields to the data source of this gallery, and then save the value in the controls to the data source.

For example:

set the OnChange property of these three controls to:

 

patch(datasource,'repeating table'.selected,{'Corresponding field1':'Desc input'.Text})

 

Then update the SP list with the fields in gallery.AllItems (that is, the fields in the gallery's data source)

Best Regards,

Bof

Hi @v-bofeng-msft,

 

Thank you for your reply.

 

Where should I put this formula, as now I already have a collection called "Purposes".

 

ClearCollect(thecollection,'repeating table'.AllItems)

 

Is it ok for putting the collection that I created for "dataSource"?

For example:

 

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

 

 

How about the ForAll() and Collect() that I created at the submit button, Do I need to make any changes at there?

 

I tried to run and it only able to retrieve one record only and the rest of the records are still blank.

 

Thank you.

Hi @kevinyong :

Is "Purposes" a data source for 'repeating table'?If yes, it's very simple.

set Field Name input's OnChange property to:

 

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

 

set Desc input's OnChange property to:

 

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

 

set Purpose input's OnChange property to:

 

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

 

finally,try this code:

ForAll( 'repeating table'.AllItems,Collect('your list',{Title:Fn,Description:Desc,Purpose:Pus……

Best Regards,

Bof

 

Hi @v-bofeng-msft,

 

Thank you for your reply.

 

It worked but only for one repeating table. As my form contains 2 repeating tables. When pressed the submit button.

image001 (2).png

The form did submit:

image002(2).png

It does transfer the first repeating table:

image003.png

But when it comes to the second repeating table. It does not transfer the ID.

image004.png

Why is that? Is there any way to fix this?

 

Thank you

 

Hi @kevinyong :

Could you tell me why there are two SubmitForm('Request Form')?Please delete the second one and try again.

Best Regards,

Bof

 

Hi @v-bofeng-msft,

 

The reason that I put 2 submit form as I tried to see is it working or not. It worked but it will have 2 different ID.

 

I deleted one of the submit form and I tried but is still the same.

 

Thank you.

Hi @kevinyong :

Try to assign the value of lastsubmit.id to a variable var after submitting the form, and then use var to update the record.

Best Regards,

Bof

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,893)