cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ghutchinsMicron
Helper III
Helper III

SharePoint List form Not Including 0 Values

The form that I developed is not recognizing a 0 in the SharePoint list for some reason.  If the value is greater than 0 it works perfect, the problem is  I get ?? BLANK ?? when it is 0.  Tried an IF statement but that is plagued with errors.  Is there some advice or help with why i dont get the list value of 0?

 

What I have now

"Previous Month Value (Kg) - " &
LookUp(
Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), // Sor t to get mos trecent on top
'Reporting Site'.Value = DataCardValue2.Selected.Value, // Pick the first entry in sorted list that matches Reported Site
'Hazardous - OffSite ReUse') // use the offsite resuse value found in the entry above

 

What I tried to do to insert a 0 but it errors out
"Previous Month Value (Kg) - " &
LookUp(
Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), // Sor t to get mos trecent on top
'Reporting Site'.Value = DataCardValue2.Selected.Value, // Pick the first entry in sorted list that matches Reported Site
(IF(
ISBLANK('Hazardous - OffSite ReUse'),0,'Hazardous - OffSite ReUse'

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@ghutchinsMicron 

There is no reason that a 0 would return as blank!!  There seems to be the start of the mystery.

 

Although the below formula would work around it...it is not correct that you would get a blank.  So I would really investigate that first!  My guess is that your Lookup is NOT returning a value at all.

 

The workaround (again, not really suggested) would be:

"Previous Month Value (Kg) - " &
Coalesce(
    LookUp(
        Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), 
        'Reporting Site'.Value = DataCardValue2.Selected.Value, 
        'Hazardous - OffSite ReUse'
    ),
   "0"
)

 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@ghutchinsMicron 

There is no reason that a 0 would return as blank!!  There seems to be the start of the mystery.

 

Although the below formula would work around it...it is not correct that you would get a blank.  So I would really investigate that first!  My guess is that your Lookup is NOT returning a value at all.

 

The workaround (again, not really suggested) would be:

"Previous Month Value (Kg) - " &
Coalesce(
    LookUp(
        Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), 
        'Reporting Site'.Value = DataCardValue2.Selected.Value, 
        'Hazardous - OffSite ReUse'
    ),
   "0"
)

 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
BCBuizer
Super User
Super User

Hi @ghutchinsMicron ,

 

Try using the Coalesce function:

 

"Previous Month Value (Kg) - " &
Coalesce(
	LookUp(
		Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), // Sor t to get mos trecent on top
		'Reporting Site'.Value = DataCardValue2.Selected.Value,  // Pick the first entry in sorted list that matches Reported Site
		'Hazardous - OffSite ReUse'), 
		0
)

 

This function goes through it's arguments and returns the first non-blank value. 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
ghutchinsMicron
Helper III
Helper III

Sincere thanks to you @RandyHayes  and @BCBuizer...  This solution did work around my problem.  Curious as to why I have the problem. Perhaps as i learn more i will look back on my efforts here and shake my head.

RandyHayes
Super User
Super User

@ghutchinsMicron 

You should not be getting a blank for a zero...that would lead to a LOT of issues!!!

 

To Test - I would put a label on your screen and set the Text property of:

LookUp(
        Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), 
        'Reporting Site'.Value = "c", 
        'Hazardous - OffSite ReUse'
)    

And see what that returns.  According to what is seen in your picture, it should show "0"

If not, then something else is going on.

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Something else is going on...  i got nothing back.  In the earlier stages of development I think it was working as expected.  In SharePoint the list was initially set up to have default column values of 0 then I was directed to remove the default of 0 which would require them to provide a response.  Not sure but now I think my issue is before Power App...  something to do with the SharePoint list perhaps.  I think what I will do to test that is delete the SharePoint list and rebuild app with the new list.  If nothing else it will give me some badly needed practice.

RandyHayes
Super User
Super User

@ghutchinsMicron 

Yes, that sounds like the issue is "list-side".  Have you looked through the list to see if there is a record for that Reporting Site that has a blank?

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
ghutchinsMicron
Helper III
Helper III

After looking at a lot of things I find that I may have the syntax wrong????  I looked closer at the function in the 'Text' property of the label and found that @RandyHayes  script is indeed fetching the value from the SharePoint list.  When I doctor it up with a bit of text to indicate what the value is the value disappears....  

 

This function does show the value from the SharePoint list.

LookUp(
        Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), 
        'Reporting Site'.Value = "c", 
        'Hazardous - OffSite ReUse'
)   

 This function does NOT show the value from the SharePoint list, adding the script in orange kills the output.

"Previous Month Value (Kg)- " & LookUp(
        Sort('Waste Disposal Data', 'First Day in Reporting Period', Descending), 
        'Reporting Site'.Value = "c", 
        'Hazardous - OffSite ReUse'
)  

 

As far as I can tell i got it right by using "Previous Month Value (Kg) - " &  yet something is still wrong.  

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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