Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Control Button DisplayMode with Formula

(0) ShareShare
ReportReport
Posted on by 4,547
I have a 'Submit' button.

The display mode of the button it to be controlled by the following formula, specifically
in all of the titles (highlighted red) are in the image Collection.

The image collection is populated by the taking of a picture using the camera control.

As written, I am getting the error - "Incompatible types for comparison. These types can't
be compared: Table, Table.".

How do I update this formula to make sure the button in 'Enabled' only if all parameters
(Invoice must be 'Install', Gallery count must be '11', and all titles are in the Collection
DisplayName, are met?

Also, if Collection count equals 10 and "Other" is NOT in the Collection DisplayName column,
'Enable' button.
 
If(
AJP_Invoice_Type_Fld.Text = "Install" And AJP_Image_Gallery.AllItemsCount =11 And
JobImageCollection.DisplayName =
["Attic Entry (If wall fish)","Exterior Entry","Install Agreement","Light at Modem",
"Modem Online","Modem Stickers","Speed Test at Furthest","Speed Test at Midpoint",
"Speed Test at Modem","Wall Plate","Other"
],DisplayMode.Edit,
 
AJP_Invoice_Type_Fld.Text = "Install"And AJP_Image_Gallery.AllItemsCount =10
And "Other" <> JobImageCollection.DisplayName, DisplayMode.Edit,DisplayMode.Disabled)
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Control Button DisplayMode with Formula
    I think you need something like this - comparing anything in a Table ( JobImageCollection ) with anything in another Table (all your values) requires a different approach.
    If(
       AJP_Invoice_Type_Fld.Text = "Install" And 
       AJP_Image_Gallery.AllItemsCount = 11 And
       CountRows(
          ForAll(
             [
                "Attic Entry (If wall fish)",
                "Exterior Entry",
                "Install Agreement",
                "Light at Modem",
                "Modem Online",
                "Modem Stickers",
                "Speed Test at Furthest",
                "Speed Test at Midpoint",
                "Speed Test at Modem",
                "Wall Plate",
                "Other"
             ] As _Data,
             LookUp(
                JobImageCollection,
                DisplayName = _Data.Value
             )
          )
       ) > 0,
       DisplayMode.Edit,
       AJP_Invoice_Type_Fld.Text = "Install" And 
       AJP_Image_Gallery.AllItemsCount = 10 And 
       !("Other" in JobImageCollection.DisplayName), 
       DisplayMode.Edit,
       DisplayMode.Disabled
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard