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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Simple (hopefully) if ...
Power Apps
Answered

Simple (hopefully) if and update context statement help - total newbie

(0) ShareShare
ReportReport
Posted on by 88

Hi All,

 

Hopefully a simple one,

I have an input field for a barcode, I then have some logic to check the length of the barcode,

 

logic.png

This works, so at the moment, if the number above is 15 characters it returns yes, if not then no, so far so good.

What I would like to do is update context if yes, or no.

 

I have tried the obvious,

If(Len(LabBarcode.Text)=15,UpdateContext({bccheck:true}),UpdateContext({bccheck:False}))

But I get a behaviour function error.

 

I would like this validation to update the visibility of the go button next to the control as seen above. Basically, the go button should only show if the number is 15 characters long.

 

Can anyone help with a method to do this please?

Many thanks in advance for any responses.

 

Categories:
I have the same question (0)
  • Verified answer
    AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    Simply make the visible property of the button:

     

    Len(LabBarcode.Text)=15

     

    if it equals 15 it will appear. Personally I choose to disable buttons but this will work to hide and show it if that is the need 🙂

     

    You should not need to use updatecontext for this scenario a variable is not needed

     

    Let me know if you need some more help or if this is the solution.

     

  • MikeWJS Profile Picture
    88 on at

    @AJ_Z Thanks very much for taking the time to reply! That's a really simple and elegant solution.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard