cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hadimarashy
Frequent Visitor

How to find if an image is blank

Hi all,

I am hoping you can help me out.

I have a form connected to the SQL database, and I want to check if an image is null by using If(IsBlank(Image38.Image),false,true).

However, after checking Image38.Image value is showing appres://datasources/inspection_plant_daily/table/%5Bdbo%5D.%5Binspection_plant_daily%5D/rows/97/inline/accumulated_debris_image even though its null in the database.

I also tried If(IsBlank(daily_inspection_gallary.Selected.all_oil_levels_image),false,true) and I get same result.

What is the best way to find if the image is null?

Thanks in advance for any suggestions.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @hadimarashy ,

 

I reproduced your problem.

This happens because "appres://" is just a reference. Regardless of whether the image/varbinary column in the database has a value, the reference will exist. So you can't use blank()/Isblank() to check if the image is blank.

 

You could use JSON function to solve it.

I did a test for you .

vxiaochenmsft_0-1637639469262.png

vxiaochenmsft_1-1637639539884.png

 

vxiaochenmsft_2-1637639565818.png

 

You could add a button to create a collection or variable.

ClearCollect(Col,ForAll(Gallery1.AllItems,JSON(ThisRecord.Image2.Image,JSONFormat.IncludeBinaryData)))

 

If the record has an image , 'appres://...' will be changed to base64.

Then you could use this rule to check which column has image value.

vxiaochenmsft_3-1637639699292.png

 

Best Regards,

Wearsky

 

 

 

 

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @hadimarashy ,

 

I reproduced your problem.

This happens because "appres://" is just a reference. Regardless of whether the image/varbinary column in the database has a value, the reference will exist. So you can't use blank()/Isblank() to check if the image is blank.

 

You could use JSON function to solve it.

I did a test for you .

vxiaochenmsft_0-1637639469262.png

vxiaochenmsft_1-1637639539884.png

 

vxiaochenmsft_2-1637639565818.png

 

You could add a button to create a collection or variable.

ClearCollect(Col,ForAll(Gallery1.AllItems,JSON(ThisRecord.Image2.Image,JSONFormat.IncludeBinaryData)))

 

If the record has an image , 'appres://...' will be changed to base64.

Then you could use this rule to check which column has image value.

vxiaochenmsft_3-1637639699292.png

 

Best Regards,

Wearsky

 

 

 

 

View solution in original post

hadimarashy
Frequent Visitor

Thank you @v-xiaochen-msft 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,921)