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

Append an array from PowerApps to a SharePoint Library column

Hi All,

 
Good day!
 
I have a array of names from powerapps that I would like to append into my SharePoint library column (person or group)
 
 
As of now I cannot append it since I'm getting an error on the REST.
 
flowws.PNG
@RezaDorrani @yashag2255 Any help would be greatly appreciated, Thank you!
2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual Super User

Re: Append an array from PowerApps to a SharePoint Library column

Hi @CarloPrincipe 

 

When appending to array variable

 

use sharepoint expanded user field as dynamic content as shown in image below

Capture.PNG

 

 

Also, no need to use the rest api for sharepoint

just use add item action and set the value of the multi person field to

 

Capture1.PNG

 

 

Regards,

Reza Dorrani

 

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

Community Support Team
Community Support Team

Re: Append an array from PowerApps to a SharePoint Library column

 

Hi @CarloPrincipe ,

 

The problem you encountered when you first started using the Rest API was because the type value you configured in the Body was incorrect, so this problem occurred.

Please could refer to the links below to solve your problem.

a-type-named-sp-data-listitem-could-not-be-resolved-by-the-model-when-a-model-is-available-each-type...

 

http://sharepointdeveloperblog.blogspot.com/2016/08/a-type-named-spdata-could-not-be.html

 

Best Regards,

Community Support Team _ Barry
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

9 REPLIES 9
Dual Super User
Dual Super User

Re: Append an array from PowerApps to a SharePoint Library column

Hi @CarloPrincipe 

 

In Flow, loop through the array of email id's and use resolve person action to ensure it is valid user and in the loop set an array variable with SharePoint expanded user field dynamic content obtained from resolve person

Capture.PNG

 

 

Then use add or update item action set the value for multi person field as the array

Capture1.PNG

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Dual Super User
Dual Super User

Re: Append an array from PowerApps to a SharePoint Library column

Hi @CarloPrincipe 

 

1. You cannot directly send an array from PowerApps to flow. It accepts only a string type input and you will have to probably create a collection out of that array and pass it to flow using the JSON function. You can refer to this blog here for using the JSON function: https://www.appliedis.com/newly-released-json-function-for-powerapps/

 

2. Any particular reason why you are using the REST API and not the direct actions? Note that perspn type columns in SP can be filled using thr email address of the user and so you can pass an array of object with the below schema: 

[
{
"Claims" : "user1@yourdomain.com"
},
{
"Claims" : "user2@yourdomain.com"
}
]

Basically, get the JSON format string from PowerApps, use the parse JSON action to get the data and populate the array and pass it to the multi select person column. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

 

CarloPrincipe
Level: Powered On

Re: Append an array from PowerApps to a SharePoint Library column

Hi Reza,

 

thanks for the reply,

 

Sorry for the incomplete information on my initial post, I think I've already done the steps you've provided, although I can be mistaken.

 

file2.PNGfile3.PNG

Dual Super User
Dual Super User

Re: Append an array from PowerApps to a SharePoint Library column

Hey @CarloPrincipe 

 

Were you able to take a look at my suggestion? You can initialize a variable out of the apply to each loop as an array variable and use the append to array variable inside the loop and use:

{

"Claims" : "select the id from the selctor here or the current item if it is array of user ids"

}

 

and you can pass this array directly. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Dual Super User
Dual Super User

Re: Append an array from PowerApps to a SharePoint Library column

Hi @CarloPrincipe 

 

When appending to array variable

 

use sharepoint expanded user field as dynamic content as shown in image below

Capture.PNG

 

 

Also, no need to use the rest api for sharepoint

just use add item action and set the value of the multi person field to

 

Capture1.PNG

 

 

Regards,

Reza Dorrani

 

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

CarloPrincipe
Level: Powered On

Re: Append an array from PowerApps to a SharePoint Library column

@yashag2255 Hi Yashag,

 

Good day!I tried what you did, but what happened was two files has been created with each having their own person name.

 

file4.PNGfile5.PNG

CarloPrincipe
Level: Powered On

Re: Append an array from PowerApps to a SharePoint Library column

Hi Reza,
I almost made it without using REST as you've suggested.

 

But there is a BadGateway error. 😞
file6.PNGfile7.PNG

Dual Super User
Dual Super User

Re: Append an array from PowerApps to a SharePoint Library column

Hey @CarloPrincipe 

 

You don't have to use the Resolve person action in the suggestion that I have provided. Just use that array with claims as the key and email as the value. In the create item action, for the collaborator claims, ar the extreme right you can see that icon right, click it and it will allow you to select the entire array over there. Put the array with the appended values here. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support Team
Community Support Team

Re: Append an array from PowerApps to a SharePoint Library column

 

Hi @CarloPrincipe ,

 

The problem you encountered when you first started using the Rest API was because the type value you configured in the Body was incorrect, so this problem occurred.

Please could refer to the links below to solve your problem.

a-type-named-sp-data-listitem-could-not-be-resolved-by-the-model-when-a-model-is-available-each-type...

 

http://sharepointdeveloperblog.blogspot.com/2016/08/a-type-named-spdata-could-not-be.html

 

Best Regards,

Community Support Team _ Barry
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

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate 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!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (6,283)