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 / Could you please help ...
Power Apps
Answered

Could you please help to check what wrong with the formula?

(0) ShareShare
ReportReport
Posted on by 180

resolved

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @GGG666 ,

    I had some involvement on this earlier - if you are updating a single record, you are better doing this

    With(
     {
     wMail:
     LookUp(
     'Home working schedule',
     Employee.Email = User().Email
     )
     },
     If(
     IsBlank(wMail.ID),
     NewForm(EditForm1_1),
     Patch(
     'Home working schedule',
     {ID:wMail.ID},
     {OUT_OF_OFFICE:"Yes"}
     )
     )
    )

    there is no need to set the variable here unless you want to use it later.

     

    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.

    Visit my blog Practical Power Apps

     

     

  • GGG666 Profile Picture
    180 on at

    Hi Thanks a lot .Though ,it still have some .

     

    These code is for a toggle. If the toggle is on the column :out_of_office of current user‘s item is yes, or else it is No

    GGG666_0-1641213552991.png

     

  • GGG666 Profile Picture
    180 on at

    GGG666_0-1641214696267.png

     

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @GGG666 ,

    Where did you put that code and what is the Error?

  • GGG666 Profile Picture
    180 on at

    Hi  WarrenBelz

     

    Toggle's OnCheck

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @GGG666 ,

    I thought you might spot that one yourself from the error message (this is a skill you will need) - I only copied your code assuming it had correct values - your OUT_OF_OFFICE is a Boolean field

    With(
     {
     wMail:
     LookUp(
     'Home working schedule',
     Employee.Email = User().Email
     )
     },
     If(
     IsBlank(wMail.ID),
     NewForm(EditForm1_1),
     Patch(
     'Home working schedule',
     {ID:wMail.ID},
     {OUT_OF_OFFICE:true}
     )
     )
    )

     

    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.

    Visit my blog Practical Power Apps

     

  • GGG666 Profile Picture
    180 on at

    Hi  

    Thank a lot. 

    In fact , I tried to switch the column to Text before.   Now it is Choice Type.

    Though, it still have error.

    GGG666_0-1641259117667.png

     

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @GGG666 ,

    Please post any relevant changes you have made as these assist greatly, especially ones you have made since the last post (it was looking for a Boolean value). Assuming your choices are Yes and No

    With(
     {
     wMail:
     LookUp(
     'Home working schedule',
     Employee.Email = User().Email
     )
     },
     If(
     IsBlank(wMail.ID),
     NewForm(EditForm1_1),
     Patch(
     'Home working schedule',
     {ID:wMail.ID},
     {OUT_OF_OFFICE:{Value:"Yes"}}
     )
     )

     

    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.

    Visit my blog Practical Power Apps

  • GGG666 Profile Picture
    180 on at

    Hi WarrenBelz,

     

    Now i change the column to Text type. 

    GGG666_0-1641263688201.png

    GGG666_3-1641264026533.pngGGG666_4-1641264041524.png

     

     

     

  • Verified answer
    WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @GGG666 ,

    We are going in circles - you have now broken your toggle. Please put it back to what it was in your original post  - Yes/No (Boolean) and the solution is in the second-last post of mine.

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard