无法根据THITEM值有条件地设置默认图像

发布于 2025-01-23 03:39:18 字数 400 浏览 3 评论 0原文

我正在使用SQL Server Image字段类型来存储记录的图像。我将图像属性设置为如此:

if(isblank(thisItem.VisorImage),'Full+Pink+Stroke+Stroke+Small+Small+裁剪(1)',thisitem.visorimage)

如果我只是将图像设置为“ Full+Pink+Stroke+Small+裁剪(1)'它可以正常工作,因此图像参考本身很好。但是我的记录都没有图像值,数据库只是显示null,我想显示默认值。如何检查空白/空图像以显示默认值?

这也没有给我我想要的。

cocece(ThisItem.VisitorImage,'Full+Pink+Stroke+STROKE+SMALL+裁剪(1)')

I'm using SQL Server IMAGE field type to store an image for a record. I set the Image attribute like so:

If(IsBlank(ThisItem.VisitorImage), 'full+pink+stroke+small+cropped (1)', ThisItem.VisitorImage)

If I set the image just to 'full+pink+stroke+small+cropped (1)' it works fine, so the image reference itself is fine. But none of my records have an IMAGE value yet, the database just shows null, and I want to display a default. How can I check for a blank/null IMAGE to display a default?

This also doesn't give me what I want.

Coalesce(ThisItem.VisitorImage, 'full+pink+stroke+small+cropped (1)')

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日裸衫吸 2025-01-30 03:39:18

目前,如果SQL Server映像为null,则无法在Power Apps中检查(我将使用产品团队创建一个错误来解决此问题)。您有几个选项:

  • 添加第二张图像控件,其中'Full+Pink+Stroke+Small+Small+Small+裁剪(1)'图像,然后重新排序,以便在图像控制之后放置使用实际图像;如果行中没有图像,则不会显示任何内容,并且将显示备份图像。
    • 如果图像具有透明像素,这可能无法正常工作

  • 在SQL表中添加了一个新列,该列显示了它是否具有图像。按照Alter Table< tableName>添加hasvisitorimage为iif(visitorImage为null,0,1),并使用此新列选择是显示原始还是备份图像:if(thisItem.hasvisorimage,thisItem.visitorimage.visorimage,'full+ full+ full+粉红色+冲程+小+裁剪(1)')

Currently it is not possible to check, in Power Apps, if a SQL Server image is null (I'll create a bug with the product team to fix that). There are a couple of options you have:

  • Add a second image control with the 'full+pink+stroke+small+cropped (1)' image, and reorder it so that it lies behind the image control with the actual image; if there is no image in the row, then it won't show anything, and the backup image will be shown.
    • This may not work well if the image has transparent pixels
  • Add a new column in the SQL table, that tells whether it has an image or not. Something along the lines of ALTER TABLE <tableName> ADD HasVisitorImage AS IIF(VisitorImage IS NULL, 0, 1), and use this new column to choose whether to show the original or backup image: If(ThisItem.HasVisitorImage, ThisItem.VisitorImage, 'full+pink+stroke+small+cropped (1)')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文