web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How to check for empty file content and take actions.

(0) ShareShare
ReportReport
Posted on by

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).

 

I have used dataUriToBinary(triggerBody()['CreatefileFileContent']) to create/convert file content.

 

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?

 

How and where would I add "Action" that would check for empty file content and if file content (image) is blank what to do?

 

Here is my floe screenshot:KPRFlow.PNG

 

 

I have the same question (0)
  • PieterVeenstra Profile Picture
    13 on at
    Re: How to check for empty file content and take actions.

    If there is no image, why would you want to create an empty file? Woudln't it be better to add a condition in your flow and only create a fiel if there is an image?

  • Community Power Platform Member Profile Picture
    on at
    Re: How to check for empty file content and take actions.

    I had an awkard requirement. Like a phone directory, if user has a picture add it if not leave empty.

    I did add a condition in a flow but that required me to  add file name and file content fiels of the flow twice. Bizarre.

     

    I end up creating two separate flow, one would add metadata with image and the other without.

    Here is the code:

    orAll(
     galKPR.AllItems,
     If(
     !IsBlank(ImageName),
     KPRAuditResultWithImage.Run(
     lstModelNumber.Selected.Value & "_" & txtHull.Text & "_" & Text(
     Now(),
     "[$-en-US]hhmmss"
     ) & "_" & cvAuditType & ".jpg",
     ImageName,
     cvAuditType,
     PassedSOPNumber,
     If(
     txtPage.Text = "NA",
     0,
     Value(txtPage.Text)
     ),
     Value(txtStep.Text),
     txtAuditCriteria.Text,
     txtHull.Text,
     Today(),
     lstModelNumber.Selected.Value,
     radPassFail.Selected.Value,
     txtComments.Text,
     If(
     whichScreen = scrScheduledAudit,
     SelectedValueStream,
     ""
     ),
     User().FullName
     ),
     KPRAuditResultNoImage_1.Run(
     "No Image",
     ImageName,
     cvAuditType,
     PassedSOPNumber,
     If(
     txtPage.Text = "NA",
     0,
     Value(txtPage.Text)
     ),
     Value(txtStep.Text),
     txtAuditCriteria.Text,
     txtHull.Text,
     Today(),
     lstModelNumber.Selected.Value,
     radPassFail.Selected.Value,
     txtComments.Text,
     If(
     whichScreen = scrScheduledAudit,
     SelectedValueStream,
     ""
     ),
     User().FullName
     )
     )
    )

    The only problem I am facing now is flow fails for the last item in the gallery because of the Flow bug, a timing issue. Here is the error:

     

    Save Conflict Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes. clientRequestId: f414fc68-f3f0-4f88-9b58-b354e9099603 serviceRequestId: ed2e8b9e-102e-6000-32c5-64e2c046bab0;ed2e8b9e-f033-6000-32c5-65fff108d2c7

     

    I have opened a bug report for the same issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 659 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 386 Moderator

#3
chiaraalina Profile Picture

chiaraalina 290

Last 30 days Overall leaderboard