Hi,
I have a powerapp generated from a sharepoint list.
The EditForm has a datacard called DataCardApproval. DatacardApproval has a TextInputBox called dataCardValueappoval.
I have two icons on the screen , When i click each of the Icons I want it to update the value in dataCardValue,
I have this in the onSelect for one of the icons: DataCardValueApproval.Text="0";
The idea is to let the user click the icon rather than needing to type in the "0", and have it save back to sharepoint when the user saves from the edit screen.
Wit the code above, when the user clicks the icon nothing happens. The text in DataCardValueApproval remains unchantged.
Any Ideas?
Solved! Go to Solution.
Set your icon to a context variable - Icon - OnSelect - UpdateContext({IconChecked: true})
Set your data card Default text - If(IconChecked, "0", Parent.Default)
Set your icon to a context variable - Icon - OnSelect - UpdateContext({IconChecked: true})
Set your data card Default text - If(IconChecked, "0", Parent.Default)
Hi @RussellGove,
you can achieve this also by setting new variable by clicking on the icon and then set set the value of variable to the value attribute of the datacard.
So first of all go to the settings of the Icon to the attribute OnSelect and write this code. (Var = variable name)
Set(Var,Var+1)
Then go to the DataCardValueXY and find the attribute Default
Default=Var
So after you do this the default value of DataCardValueXY will be Var+1 each time you press the Icon. So you have to limit it by customizing the code a bit.
Set(Var,If(Var="1",Var-1,Var+1))
That works as I expereinced it.
The other thing is, that the default value could be faulty as it doesnt update properly each time from my experience. So in this case you would need to use another action to update the DataCardValueXY.
Something like OnSelect property of icon
Set(Var,If(Var="1",Var-1,Var+1));DataCardValueXY.Text=Var
but i have never tested this scenario so no promises of functionality 🙂
Hope it helps.
User | Count |
---|---|
169 | |
90 | |
74 | |
67 | |
57 |
User | Count |
---|---|
213 | |
154 | |
97 | |
89 | |
68 |