Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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.

 

  • MikeWJS Profile Picture
    88 on at
    Re: Simple (hopefully) if and update context statement help - total newbie

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

  • Verified answer
    AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at
    Re: Simple (hopefully) if and update context statement help - total newbie

    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.

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard