cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to add record to a library using PowerApps

In my gallery, some items have images (pictures taken by device camera) and some don't. I have successfully created a flow that would add items to SharePoint library but flow fails when there is no image for particular item(s). Hence I tried to do use patch function for items where there is no image and in patch function I checked if Image isBlank() then Patch the library. But Patch fails and SharePoint server error suggests to use SPFileCollection.Add().

 

How would I do that or any suggestion?

 

Is there any way I can supply a blank value for image ( I tried " ", but did not work)? Would Blank() work?

I have a pseudo code for the combined implementation :

ForAll(gallery.AllItems,If(!IsBlank(Image),CallFlowThatAddItemToSharePointLibrary,ElseCallPatch( LibraryName, Defaults(LibraryName),{ColumnName1:Value1, ColumnName2:Value2,.....})))

 

Any suggestion is appreciated.

Note: I doubt that patch works on library. It worked fine for SharePointList because list does not have file content where as library has a file content.

4 REPLIES 4
Lisabel0
Level 8

Re: How to add record to a library using PowerApps

Have you made this successfully work with images exist for the items?

Community Support Team
Community Support Team

Re: How to add record to a library using PowerApps

Hi @Anonymous,

 

Are you using method in below blog to upload the images to SharePoint library:

https://www.techmikael.com/2017/05/saving-collection-of-images-from.html?showComment=1495199384722#c3722874462677054296

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: How to add record to a library using PowerApps


@Lisabel0 wrote:

Have you made this successfully work with images exist for the items?


Yes, I did as I mentioned in my post using flow. I successfuiiy uploaded images but I can not with there is no image but all metadata. 

Anonymous
Not applicable

Re: How to add record to a library using PowerApps

Yes I did


@v-monli-msft wrote:

Hi @Anonymous,

 

Are you using method in below blog to upload the images to SharePoint library:

https://www.techmikael.com/2017/05/saving-collection-of-images-from.html?showComment=1495199384722#c3722874462677054296

 

Regards,

Mona


Yes, I did. If there is no image, flow fails as I mentioned in my post.

Helpful resources

Announcements
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!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,809)