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 / Button visibility base...
Power Apps
Answered

Button visibility based on two conditions

(0) ShareShare
ReportReport
Posted on by 1,712

Hello,

I have a PowerApps screen that contains a gallery connected to my SharePoint data source, inside this gallery I have a button that opens a PopUp in the same screen. In this Popup, I have a PenInput box and a submit button. When the users add his signature and if it was the first time I am storing his signature to an SP list, then if he came back to sign a new item I am populating the image of the user that is stored in this List.

onSelect property of the submit button I have a function that sends an email for the user that includes the signature image.

What I want to achieve is the following:

I have assigned for the Visible property of this button, if the PopUp is true and if the EmptySign <> CurrentSignature (Till here everything is working). Now this condition was based if the user was the first time adding his signature. Now after the signature is stored and the image is populated I want to display the button back again so he will be able to submit his signature for new items. So I want to add for the same condition another one that checks if the image IsNotBlank to display the button.

More details about the variables:
The button before opening the Popup here is the initialized variables:

Set(SelectedReport,ThisItem);UpdateContext({PopUp:true});

The EmptySignature variables are initialized onvisible of the screen and which is the following with Timer variables:

Set(EmptySignature, Substitute(JSON(PenInput1.Image, JSONFormat.IncludeBinaryData), """", ""));
Set(IsStart, false);Set(IsStart, true);

The CurrentSignature variable is initialized onTimerEnd of the Timer Control:

Set(CurrentSignature, Substitute(JSON(PenInput1.Image, JSONFormat.IncludeBinaryData), """", ""))
Start: IsStart
Duration: 2000
Repeat: true

Visible of the submit button:

If(
PopUp = true && EmptySignature <> CurrentSignature,
true,
false
)

Unfortunately, the button is not displaying after the image is populated. To summarize, so if the user was the first time adding his signature the first condition should be met and display the button to submit, or if the image is already populated in the popup which means the signature already stored then the button should be also visible. Both conditions the Popup should be true.

Please have a look at the below GIF which shows a new item that the user should be able to submit his signature and the button is not displaying:
Demo.gif
Can please someone explains in detail and provide an example?

Any help will be greatly appreciated.
Thank you!

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Julien2 ,

     

    It seems the issue is from the second part condition (EmptySignature <> CurrentSignature).

    Could you add a label to show to show the result of 'EmptySignature <> CurrentSignature'?

    I find that you had drawn signature in PenInput control before, it may cause the EmptySignature to be generated the same as CurrentSignature, resulting in the visible of Submit Button to false.

    Please try to use Reset(PenInput1) code to clear the signature and try again.

    Hope this helps.

    Sik

     

     

  • Verified answer
    EBMRay Profile Picture
    1,712 on at

    Hello @v-siky-msft ,

    The second part of the condition is working perfectly.
    Yes, I have drawn and stored the signature before based on GIF that I have mentioned.

    I have already used Reset(PenInput1) onVisible of the screen but I forgot to mention that.

    Finally, I have resolved the issue by adding an or operator for the send signature button Visible property the following:

    If(
    PopUp = true && EmptySignature <> CurrentSignature || !IsBlank(Image3.Image) && PopUp = true,
    true,
    false
    )

    So now the button is visible when the image contains data.

    Thank you!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard