cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
miho-s
New Member

Error of Flow for creating item in sharepoint when a file uploaded in document library

i am creating Flow to create item in SharePoint list when a file uplloaded in SharePoint document library. However sometimes it doesn't work as expected. Could you give me some advice on this?

 

In the document library, there is some columns and a data is filled in each column.

 

Columns in SharePoint Documnet library

 

I creat the same columns in SharePoint list and in the Flow, I configure it to copy the data from documnet library column to the corresponded SharePoint list column.

However, as i run this test several times, it fails to copy the data from document library column to list column sometimes.

Here is the example. File "050801" is the failed file. File "DOO" is successful file.

 

Columns in SharePoint List

 

For the failed Flow, Flow "Run history" status shows "Succeeded". However, when i check the detailed log, it seems it failes to get the data because it says "null" where is supposed to have a data.

We perform test on the several PC using several user accounts, same file but it intermittently happen and it's difficult to get the reason of this failure.

Could somebody tell me what is the possible reason of this issue?

 

Here is the part of Flow log for action part(Create item)

 ================================================

item
{
  "Title""XXXX 050801",
  "h91r"null,
  "idmm"null,
  "i8t7"null,
  "twil"null,
  "sbbw"null,
  "j1h0""XXXX-201825",
  "mles""https://xxxxx.sharepoint.com/teams/xxxxxx/xxxxxx/Shared%20Documents/xx/xxxx%20050801.xlsm?d=w9a917099cd1b4f7bab38a6e608c0329b",
  "OData__Status": {
    "Value""Not Started",
    "@odata.type""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
  }
}

 ==================================================

 

Thanks in advance.

3 REPLIES 3
Community Support
Community Support

Re: Error of Flow for creating item in sharepoint when a file uploaded in document library

Hi @miho-s,

 

Could you please share a screenshot of your flow's configuration?

Do you add a "When a file is created or modified (properties only)" trigger as the trigger of your flow?

Further, do you create some custom columns within your SharePoint library?

 

I think this issue is related to the trigger that you specified within your flow. If you created some custom columns within your library and want to fill them, you could only fill these columns after the file is uploaded.

 

When you uploaded a new file into your SharePoint library, the trigger that you specified within your flow would be fired, but these custom columns that you specified within your library have not been provided with a value, so the "Create item" action would create an item where these corresponding columns are empty. 

 

I have made a test on my side and please take a try with the following workaround:22.JPG

Within Condition box, left input box set to Created dynamic content of the trigger, right input box set to Modified dynamic content of the trigger.

 

or you could click "Edit in advanced mode", type the following formula:

@equals(triggerBody()?['Created'], triggerBody()?['Modified'])

the flow works successfully as below:23.JPG

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
miho-s
New Member

Re: Error of Flow for creating item in sharepoint when a file uploaded in document library

Hi Kris,

 

Thank you for your check my problem and reply.

This is the Flow I created for the SharePoint.

 Flow_0515.png

 

Flow is consisted of 1 trigger and 2 actions now.

1. Trigger - "When a file is created or modified (properties only)"

2. Action #1 - "Send an email"

3. Action #2 - "Create item"

 

About the trigger,

I add a "When a file is created or modified (properties only)" trigger as the trigger of my Flow.

And I create some custom columns within my SharePoint library for document parser.

I want to set specific data within Excel file into a library column along with the document detaills.

 

As I thought the transaction is too fast between Trigger and Action #2 to get data from document library columns, i add one more Action #1 between the trigger Trigger and Action #2 but situation is same. It failes intermittently.

 

What I want to create using Flow is document management. We upload documnet into SharePoint and want to assign unique number for each document.

I wanted to create column for unique number in document library but it seems Flow desn't support "Create item" action for document library so now I copy the data to list for document management. 

 

Coudl you tell me what is the problem with my Flow....? Do you have another idea for this?

miho-s
New Member

Re: Error of Flow for creating item in sharepoint when a file uploaded in document library

Hi Kris,

 

I realized i can assign unique number in a document library column for each document using Flow.

I use "SharePoint - Update file properties" as action in my Flow. Prepare column for unique number and assign unique ID using [ID] properties. So my problem can be resolved using alternative solution. Thank you very much for your advice!

 

Support for SharePoint Document Library Properties | Flow Blog

Support for SharePoint Document Library Properties

https://flow.microsoft.com/en-us/blog/support-for-sharepoint-document-library-properties/

 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,425)