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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error using If ad Upda...
Power Apps
Answered

Error using If ad UpdateContext to hide a PopUp with variable

(0) ShareShare
ReportReport
Posted on by 21

Hello,
I'm trying to use the hide a confirmation button on a popUp using the below code OnSelected.

# 1 option - no error informed at the context

If(
DeleteOption = "Customer"; //Variable
    Remove(SalesApp_Clientes;CustomersGallery.Selected); //works perfectly, del the customer on the gallery
     UpdateContext({DeletionPopup: false}) // doesn't work
)

# 2 option - Error Invalid argument type. Expecting one of the following: Boolean, Number, Decimal, Text, OptionSetValue, UntypedObject- 


If
(
DeleteOption = "Customer"
    Remove(
           SalesApp_Clientes;
           CustomersGallery.Selected
      )
);
UpdateContext({DeletionPopup: false}) // doesn't work


# 3 option - Error Invalid argument type. Expecting one of the following: Boolean, Number, Decimal, Text, OptionSetValue, UntypedObject- 


If
(
DeleteOption = "Customer"
    Remove(
           SalesApp_Clientes;
           CustomersGallery.Selected
      )
) &&
UpdateContext({DeletionPopup: false}) // doesn't work

Some one can help me?
Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    37,137 Super User 2026 Season 1 on at

    @gpcamillo 

    Taking your first example, the separator symbol between the Remove and UpdateContext functions should be 2 semi-column characters (;;).

    I would try the following to see if that makes a difference.

     

    If(
     DeleteOption = "Customer"; //Variable
     Remove(SalesApp_Clientes;CustomersGallery.Selected);; 
     UpdateContext({DeletionPopup: false})
    )

     

  • gpcamillo Profile Picture
    21 on at

    Thank you @timl !
    Works perfectly.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 899

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 499

Last 30 days Overall leaderboard