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

Community site session details

Session Id : zgtR/cA4bEV5WnGM6Smbwh
Power Apps - Building Power Apps
Answered

Status

Like (0) ShareShare
ReportReport
Posted on 10 Feb 2020 08:37:24 by Super User 2024 Season 1

Hi,

I have a Choice field of status.value and its Open Or close how can i make easy like button to click to close or click again to Reopen 

stausopenclose.png

  • Ramole Profile Picture
    Super User 2024 Season 1 on 11 Feb 2020 at 07:48:06
    Re: Status

    Hi @WarrenBelz 

     

    I Try this on the Default value of StatusChoose

    If(
    !isBlank(vReset) && ThisItem.IsSelected,
    vReset,
    Parent.Default
    )

    DID NOT WORK BUT WHEN I TRY BELOW IT WORKED.

    If(ThisItem.IsSelected,vReset,Status.Value)

    @WarrenBelz   thank you for helping me đź‘Ś

     

  • Verified answer
    WarrenBelz Profile Picture
    149,158 Most Valuable Professional on 11 Feb 2020 at 07:12:55
    Re: Status

    @Ramole 

    You did not say your drop down was in a gallery and there was one for every item - I missed this in your last post as I could not enlarge the screen shots enough.

    Try this on the Default value of StatusChoose

    If(
     !isBlank(vReset) && ThisItem.IsSelected,
     vReset,
     Parent.Default
    )

     

    Please click Accept as solution 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 Thumbs Up.

     

  • WarrenBelz Profile Picture
    149,158 Most Valuable Professional on 11 Feb 2020 at 05:06:11
    Re: Status

    Sorry same issue

    If(
     !isBlank(vReset),
     vReset,
     Parent.Default
    )
  • Ramole Profile Picture
    Super User 2024 Season 1 on 11 Feb 2020 at 04:46:54
    Re: Status

    Hi @WarrenBelz 

     

    StatusChose dropdown Default i have changed to only VReset and error gone then button changes the open close,

    If(
     !isNull(vReset),
     vReset,
     Parent.Default
    )
    THIS IS NOT WORKING AS IT GIVES AN ERROR 

    but the only problem is changing all status on the gallery not only the selected record? 

     

     

  • WarrenBelz Profile Picture
    149,158 Most Valuable Professional on 11 Feb 2020 at 04:35:27
    Re: Status

    Try 

    UpdateContext({vReset:Blank()})
    instead of 
    UpdateContext({vReset:Null()})

    I was working on a Flow when I responded to you and gave you the wrong syntax for clearing.
    Also no need to rename controls - I just needed to know their names.

     

    Please click Accept as solution 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 Thumbs Up.

  • Ramole Profile Picture
    Super User 2024 Season 1 on 11 Feb 2020 at 04:25:39
    Re: Status

    Hi @WarrenBelz 

    i rename controls ChangeButton for button and the dropdown status is StatusChoose and still error

     

    Thanks error101.pngerror103.pngSTATUSERROR2.png

  • WarrenBelz Profile Picture
    149,158 Most Valuable Professional on 11 Feb 2020 at 02:54:45
    Re: Status

    @Ramole ,

    I bit hard to see from your screenshots.

    Can you please give me:

    • The name of your control I referred to below as ChangeButton and include all of the OnSelect code
    • The name of your control I referred to below as StatusChoose and include all of the Default code
    • The full code of the OnVisible of the screen that these control are on
    • A screenshot of your screen

    Thanks

  • Ramole Profile Picture
    Super User 2024 Season 1 on 11 Feb 2020 at 02:38:18
    Re: Status

    Hi @WarrenBelz 

     

    Thanks for replay but i am having a problem to work please see the screen shot if i missed anything 

     

    Thanks

    error10.pngstatus choice error.png

  • WarrenBelz Profile Picture
    149,158 Most Valuable Professional on 10 Feb 2020 at 11:10:01
    Re: Status

    Hi @Ramole ,

    So that I understand you correctly, you have a 

    • Drop down field that says either Open or Close and the source data field is a Choice field also and the drop down values are driven from this field.
    • You want a button to change this to either Open or Close (instead of selecting from the drop down) and each click changes it to the other value from what it is presently

    For this example I will use the names (replace these with your field and control names)

    • StatusChoose for the Choice field]
    • ChangeButton for the button
    • vReset for a Variable I will use

    So the OnSelect of ChangeButton would be

    If(
     StatusChoose.Selected.Value = "Open",
     UpdateContext({vReset:"Closed"}),
     UpdateContext({vReset:"Open"})
    );
    Reset(StatusChoose)

    On the Default value of StatusChoose would be

    If(
     !isBlank(vReset),
     vReset,
     Parent.Default
    )

    One last thing - on the OnVisible property of the screen<

    UpdateContext({vReset:Blank()})

    All of this should do what you need.

     

    Please click Accept as solution 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 Thumbs Up.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete