cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jean_9681
Helper I
Helper I

Show Button only in display form

Hello Everyone,

I have Customized PowerApps form for my SharePoint list and i have add a button to an hyperlink column and would like to make the button visible only in display form. 

Here is what i have on the button displaymode and the button is visible in both edit and display form,  
Visible = If(SharePointForm1.Mode=1,false,true)

And i would like this button to be visible only when it contains value. 

Any suggestions on how to configure this.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@Jean_9681 

Sorry, my bad...I meant :  SharePointForm1.Mode = FormMode.View

 

Now, with the other factor, your Visible property would be based on the column value not being blank:

 SharePointForm1.Mode = FormMode.View && !IsBlank(ThisItem.yourHyperlinkColumnName)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

14 REPLIES 14
RandyHayes
Super User III
Super User III

@Jean_9681 

Please consider changing your Visible Property Formula to the following:  SharePointForm1.Mode = FormMode.Display

You don't need the If and true false stuff, this formula will return true or false already.

 

You then say "And i would like this button to be visible only when it contains value." - I am not sure what you are referring to on this.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes Thank you so much for sharing the formula, unfortunately its not working not sure if i am doing it right.

1. When i try this formula the button is not visible in display mode

Jean_9681_0-1614697757819.png


2. "And i would like this button to be visible only when it contains value."
Its an hyperlink column and does not have a link/value added to it all time, i want the button to be visible only when the hyperlink column has a value/link added, if blank the button should not be visible. 

RandyHayes
Super User III
Super User III

@Jean_9681 

Sorry, my bad...I meant :  SharePointForm1.Mode = FormMode.View

 

Now, with the other factor, your Visible property would be based on the column value not being blank:

 SharePointForm1.Mode = FormMode.View && !IsBlank(ThisItem.yourHyperlinkColumnName)

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

@RandyHayes  - This works,   SharePointForm1.Mode = FormMode.View 

but it ended up with another problem now, The button is a pain text now and its not clickable anymore..

For the button -OnSelect - i have this Launch(DataCardValue5.Text)

RandyHayes
Super User III
Super User III

@Jean_9681 

This property change will not impact what you are saying is now the case.  
Are you stating that if you remove the formula we just put in and replace it with true, that the button works properly?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Yes, the button is clickable with this formula If(SharePointForm1.Mode=1,false,true)

RandyHayes
Super User III
Super User III

@Jean_9681 

I'm not completely following what is going on.  Your button is either visible or not based on the Visible property.  This does NOT impact click-ability, only Visibility. 

So, what is the DisplayMode property of your button?  This determines click-ability.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

This is what i have for the DisplayMode property for this button
DisplayMode = Edit 

More info

This is what i have done so far

1. Created an hyperlink column in SharePoint list
2. In PowerApps -
2.1- Changed the visible for hyperlinkdatacard to false
2.2 Under Hyperlink datacard > Created an HtmlText
and added this formula
Concatenate("<a href='",DataCardValue.Text,"'>",DataCardValue.Text,"</a>")
2.3 > Turned of the visible for this HtmlText
3.Created a Button outside SharePointForm1
And changed the property's of this button
OnSelect - Launch(DataCardValue.Text)
Visible - If(frmChangeForm.Mode=1,false,true)

 

RandyHayes
Super User III
Super User III

@Jean_9681 

To be clear...is that the actual formula in the DisplayMode property?  (DisplayMode = Edit) or is it just Edit?

Can you provide a screenshot of what you are seeing?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,962)