Hi,
I have field 1, field 2, field 3 and I would like to set field 4 = field 1 + field 2 + field 3
How do I set this in Power Apps?
Solved! Go to Solution.
Please clarify "field"? A field is not one of the control or text types. I will assume you have either a label or a text input. The text property of these are read as strings and not numbers (values). I am also assuming your "field 4" is a label.
Set the text property of the label you want to be the sum to:
Value(label1.text) + Value(label2.text)
If the assumptions are wrong, please provide more information.
Hello @cooltechie,
I prepared a small demo for solving this:
1. Create an empty app
2. Add an empty vertical gallery control (Gallery1) and a button control (Button1)
3. Button1.OnSelect=ClearCollect(cc, {a:1, b:11}, {a:2, b:12}, {a:3, b:13}, {a:4, b:14})
*This means select the Button1 control, find its "OnSelect" property and paste ClearCollect(cc, {a:1, b:11}, {a:2, b:12}, {a:3, b:13}, {a:4, b:14}) into it.
4. Add 3 Label controls into your Gallery (Label1, Label2 and Label3). Note that those controls should be added inside your gallery, not on screen level.
5. Set Gallery1.Items=AddColumns(cc, "Sum", Sum(a, b))
6. Set Label1.Text=ThisItem.a
Label2.Text=ThisItem.b
Label3.Text=ThisItem.Sum
7. Preview the app and click on the button.
Please clarify "field"? A field is not one of the control or text types. I will assume you have either a label or a text input. The text property of these are read as strings and not numbers (values). I am also assuming your "field 4" is a label.
Set the text property of the label you want to be the sum to:
Value(label1.text) + Value(label2.text)
If the assumptions are wrong, please provide more information.
Actually I am using SharePoint list field values. May be I should use a calculated field to sum the total