Hi I'm using the following function in my power app form
I've three column in my power app ( sharepoint list data source , column type Number )
The first column is autopopulated when user logs in "UNIT RATE "
the second column value is manullay entered by the user " Quantity "
The third column is where I need to calculate the ( quantity * Unit rate)
Update of amount column : Value(DataCardValue2.Text)
update of amount datacard : ThisItem.Amount
update of amount datacard value =
the amount columnn is still showing as blank
Could anyone please help to fix this issue
Yeah of course, happy to explain!
Will put comments in it here:
If(
//Here we check the length of the text in the textinput
// If it is zero then there's nothing in it
Len(QuantityTextInput.Text)=0
// The double pipe here '||' is another way to write 'Or'
// I prefer this to 'Or' and I use '&&' when I need to do 'And'
||
//Here we check the length of the text in the textinput
// If it is zero then there's nothing in it
//The reason we check the second item as well is that
// it will try multiply by a non-existent value if its empty
Len(UnitRateTextInput.Text)=0,
// In both of those cases we want it to then be blank
Blank(),
// if both of the above have values then we can safely multiply
// however, their .Text property is a text, nto a number, so
// we use Value() wrapped around it to convert the text to number
// this then enables us to multiply the numeric values :)
Value(QuantityTextInput.Text) * Value(UnitRateTextInput.Text)
)
Cheers,
Sancho
Thanks man that worked perfectly fine
Could u please be details how did u end up with this formula
Hey @Anonymous
You are referring to ThisItem - but that refers to a value that already exists in a record (ie like the Original value before user changes), whereas you said that the user is entering it.
I would instead refer to the TextInput controls themselves in this case:
If(
Len(QuantityTextInput.Text)=0
||
Len(UnitRateTextInput.Text)=0,
Blank(),
Value(QuantityTextInput.Text) * Value(UnitRateTextInput.Text)
)
Cheers,
Sancho
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1