cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sasidhar_mudra
Level: Powered On

Save Multiple Values in Multiple rows in Sharepoint List

@v-xida-msft , All,

 

I have a question. Not sure whether it is possible to  execute or not. Require your help as always.

I have a SP List with the columns as shown in the reference pic. 

 

Note: Employee Name is people picker column in sharepoint.

 

I created an app where i can select multiple employee names via people picker and want to save it to SP list. Here is where I am struggling. I want different names in different rows and not in a single row. The pic below may give you an idea. Is it possible to patch multiple values selected from people picker column in app to SP list? 

On the other hand, when i tried using a text column where i can enter employee names manually in Text Input, I was able to save it in the SP list using the below code (";" being the separator) 

 

However, i am not sure how to split the names and add it to the SP list as different rows from people picker. 

 

For example, if i select ABC; BCD; CDE; in employee name, i want them to save in sharepoint list as different rows as below
ABC

BCD

CDE

 

Kindly help.

 

FGD1.JPGFGD2.JPG

 

Thanks in advance.

 

Regards

Sasidhar

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
v-siky-msft
Level 10

Re: Save Multiple Values in Multiple rows in Sharepoint List

Hi @sasidhar_mudra ,

 

That is really wired! I post my steps as below, please take a try and check if you issue still remains. I recommend you test on a new App.

1. Test on SP list name "Test 0910" with a "pp2" column (Person column, allow multiple selection)

2. Create a combo box, set the items property to Choices('Test 0910'.pp2)

3. Create a button, set OnSelect property as below

 

ForAll(ComboBox2.SelectedItems,Patch('Test 0910',Defaults('Test 0910'),{Title:"Test",pp2:Table({Claims: Claims,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""})}))

 

When I select four items in combo box, and click the button, the SharePoint list will create four rows, and four people are filled into four rows respectively.

Snipaste_2019-11-14_16-05-19.pngSnipaste_2019-11-14_16-06-11.png

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

View solution in original post

10 REPLIES 10
v-siky-msft
Level 10

Re: Save Multiple Values in Multiple rows in Sharepoint List

Hi @sasidhar_mudra ,

 

Do you want to patch multiple people to different rows?

Do you use combo box to select the people?

 

If so, you should set Items property of combo box to Choices('SP list'.EmployeeName) .

Also set the following formulas to OnSelect property of button

 

ForAll(ComboBox1.SelectedItems,Patch('SP list',Defaults('SP list'),{Title:"SA",EmployeeName:{Claims: Claims,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""}}))

 

Annotation 2019-11-05 144120.png

Annotation 2019-11-05 143457.png

Hope this helps.

Best regards,
Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

 

sasidhar_mudra
Level: Powered On

Re: Save Multiple Values in Multiple rows in Sharepoint List

@v-siky-msft ,

 

Sorry for the delay in responding. Could not try this earlier.

 

Tried your input. I see an error. PFB screenshot. Not sure why the error.

 

However, i have another question. What if i have two combo boxes in the same form, is there a possibility of making them independent of one another.

 

FGD3.jpg

 

Thanks

Sasidhar

v-siky-msft
Level 10

Re: Save Multiple Values in Multiple rows in Sharepoint List

Hi @sasidhar_mudra ,

 

It seem that your Employee Name column allow multiple selection, right?

So we should patch a table to Employee Name column, just use Table() function. Please modify the formula as below:

 

ForAll(ComboBox1.SelectedItems,Patch('SP list',Defaults('SP list'),{Title:"SA",EmployeeName:Table({Claims: Claims,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""})}))

 

 

 Best regards,

Sik

 

sasidhar_mudra
Level: Powered On

Re: Save Multiple Values in Multiple rows in Sharepoint List

@v-siky-msft ,

 

Hi Sik,

 

Apologies for the delay. I am out of office. I tried with the above mentioned formula, however, i was still receiving the error.

 

 

Thanks

Sasidhar 

v-siky-msft
Level 10

Re: Save Multiple Values in Multiple rows in Sharepoint List

Hi @sasidhar_mudra ,

 

Could you share the more error information ?

Does your Employee Name column allow multiple selection?

 

Best regards,

Sik

sasidhar_mudra
Level: Powered On

Re: Save Multiple Values in Multiple rows in Sharepoint List

@v-siky-msft ,

 

yes, it allows multiple selection. 😞

Highlighted
v-siky-msft
Level 10

Re: Save Multiple Values in Multiple rows in Sharepoint List

Hi @sasidhar_mudra ,

 

That is really wired! I post my steps as below, please take a try and check if you issue still remains. I recommend you test on a new App.

1. Test on SP list name "Test 0910" with a "pp2" column (Person column, allow multiple selection)

2. Create a combo box, set the items property to Choices('Test 0910'.pp2)

3. Create a button, set OnSelect property as below

 

ForAll(ComboBox2.SelectedItems,Patch('Test 0910',Defaults('Test 0910'),{Title:"Test",pp2:Table({Claims: Claims,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""})}))

 

When I select four items in combo box, and click the button, the SharePoint list will create four rows, and four people are filled into four rows respectively.

Snipaste_2019-11-14_16-05-19.pngSnipaste_2019-11-14_16-06-11.png

Best regards,

Sik

If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

View solution in original post

sasidhar_mudra
Level: Powered On

Re: Save Multiple Values in Multiple rows in Sharepoint List

@v-siky-msft ,

 

Thank you so much... You've been persistent in getting me the solution. Really appreciate it 🙂

It worked 🙂

 

I would like to understand the below if you can. I do not understand this.

pp2:Table({Claims: Claims,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""})

 

Thank you once again Sik...

 

 

Regards

Sasi

v-siky-msft
Level 10

Re: Save Multiple Values in Multiple rows in Sharepoint List

Hi @sasidhar_mudra ,

 

Because your person column allow multiple selection, so you should patch a table instead of record to the column.

Table function is to create a temporary table, for more reference : Table function in PowerApps 

Best regards,

Sik

 

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,155)