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.