I have a Sharepoint list set up as a Data Source in a PA App and I'm doing a simple ClearCollect into a Collection to gather this data for manipulation :
The Sharepoint List has a Lookup Column, SupplierID, which displays as follows :
It pulls from a list called "Suppliers" and takes the "SupplierID" value from that list :
I mention all this just because this is the only thing I can think of that might be causing this weird issue. Despite the value showing here as "97", if we look at the collection in PowerApps :
I've no idea why it gives a seperate ID/Value, but that can be worked around by using SupplierID.Value. However this produces an output of 97.000000000000 instead of 97 as expected, which is causing issues in my App.
Any idea how to work around this?
hi @Powertron,
Looking at your explanation, I couldn't spot any errors, your reasoning is correct. I think the collection "colSupplierContact" can have only 1 record. Maybe this is the problem, look in collections of your app and verify how many records colSupplierContact have. I'm a little bit curious if this is the error.
My numbers are all whole numbers, between 1 and 4 digits, should not contain any decimals. I think I might be having another issue to be honest, as I think I've got the formatting sort of working, but I'm getting the wrong results.
I have a gallery built off the "Suppliers" Sharepoint as follows :
The "Suppliers" button feeds into a variable :
This is used by a second table which is fed from the "Supplier Contacts" table, and its supposed to use the SupplierID value to select all the supplier contacts for each supplier, when I click the "Suppliers" button.
There is a text box at the top that indicates the Supplier Name and the number of Contacts the supplier has, and that illustrates the issue I'm having :
So the first part works fine, the supplier name is contained in my "Suppliers" list and is collected into the "colSuppliers" collection, from which it is correctly identified.
The issue is the second part. This particular supplier has 4 contacts, as you can see its listing one. It IS listing one of the 4 contacts which are assigned to this supplier in my gallery however, using this code :
(yes I know there is a delegation issue, I actually usually pivot off another hidden gallery to avoid this, I've just bypassed that for ease of explanation here).
This only lists one of the four entries in the colSupplierContact list, and I cannot for the life of me work out why.
From the code I can see it correctly knows that the varSupplierContact.SupplierID value is 62 :
So I can't figure out why this isn't working.
As @Ygor said this can be handled by some simple text formatting. This is another of many examples as to why complex columns are an issue in Power Apps. There are ways to not have to use them and they genreally making creating a functioning app much more simple. The easiest way to format this is by using the Text function:
Text([number/text to format], "formatting")
Tips
"#.##" and your value is 0.40 it will display .4
"0.#0" and your value is 0.40 it will display 0.40
# means show any non-zero number in this spot while 0 means show any non-zero number in this spot and if there isnt one then add a 0. This is how you get leading or trailing 0s to show.
"0000.0000" and your value is 1.58 with display 0001.5800 for example. Hope this helps!
Hi @Powertron,
Searching about this, I found this topic, basically, this is a known issue with SharePoint calculated fields. They fixed it in some ways.
Round(Value(Parent.Default),2)
Or
Text(Value(Parent.Default),"[$-en-US]#.0")
Or
Text(Value(Parent.Default), "#.00")
I used the third formula and it worked in my app.
If this solves your question, would you be so kind as to accept it as a solution.