cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Next button disabled if SharePoint field is blank

Hey everyone

I have another question, how do I disable a next button from navigating to the next screen if a column in my SharePoint is empty, I have seen I can disable the button if a DataCardValue is blank, something like 

If(IsBlank)DataCardValue1.Selected),notify("provide data") 

 

When I type in the column name, it does not work?

 

If(IsBlank)myname),notify("provide data")

13 REPLIES 13
Highlighted
Super User
Super User

Re: Next button disabled if SharePoint field is blank

@PowerAGuy 

Put this code in the DisplayMode property of the button

If(IsBlank(DataCardValue1.Selected), DisplayMode.Disabled, DisplayMode.Edit)

 

Note: I do not know the type of control for DataCardValue1 so I assumed it was a Dropdown.  If this is a ComboBox use IsEmpty instead.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper II
Helper II

Re: Next button disabled if SharePoint field is blank

Hello @mdevaney 

 

I already have it working for when it is looking at a Power apps field, I want it to look at my Share Point field to determine if it has any data.

Reason for this is I have 2 approvers when approver1 has completed all the fields the next button allows the user to navigate to approver2 sccreen but I want them to save the data first, before attempting to navigate away from the screen.

If there is a better way of doing this please let me know, I thought disabling the next button was an option?

Highlighted
Super User
Super User

Re: Next button disabled if SharePoint field is blank

@PowerAGuy 

Yes, disabling the Next button is an option.  That is what I am telling you about.

 

If you want to do a lookup in your SharePoint list do this instead.

If(
    IsBlank(LookUp(your_datasource_name, ID = ThisItem.ID)),
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper II
Helper II

Re: Next button disabled if SharePoint field is blank

@mdevaney 

 

Think we're nearly there, I tried the way but i get the following errors:

If i hover over = 'Invalid argument'

If i hover over ThisItem Name isnt valid.This identifier isnt recongnised

If i hover over . Invalid use of '.'

If(IsBlank(LookUp(List,ID = ThisItem.ID)), Notify("Approve or reject please", NotificationType.Error),

Highlighted
Super User
Super User

Re: Next button disabled if SharePoint field is blank

@PowerAGuy 
The formula looks find so the property you put it inside might be causing the problem.

Can you please take a screenshot that shows:

  • The formula bar
  • Which property the code is in
  • Which control the code is in

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

Highlighted
Helper II
Helper II

Re: Next button disabled if SharePoint field is blank

@mdevaney 

Thank you for your help, here is the screenshot, the code is in a buttons OnSelect property:

lookup error.PNG

 

I've added a new button and tried the same but doesnt work, after typing in ID = the list of options for me to select do not include ThisItem

Highlighted
Super User
Super User

Re: Next button disabled if SharePoint field is blank

@PowerAGuy 
Please also show me the left controls menu with the button highlighted

Highlighted
Helper II
Helper II

Re: Next button disabled if SharePoint field is blank

@mdevaney 

 

I think this is what your asking for?
I've tried the code both on the highlighted which is a new test button but also on the Icon2_10:

 

LeftMenu.PNG

 

Highlighted
Super User
Super User

Re: Next button disabled if SharePoint field is blank

@PowerAGuy 

The ThisItem property can only be used within in a Form or a Gallery.  That is why you are getting an error.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,137)