I am hoping to have a pop up that will appear when someone clicks on a "help icon" beside buttons.
However, there are seven help buttons. I don't want to have to create 7 seperate popups (A rectangle with text boxes, that are only visible when a variable is set). This would get crowded fast, as well as surely impact performance.
What I am hoping to do is something like this:
Set(HelpVariable, 1);
Set(TestFont2, "ScoringLabel" & HelpVariable & ".Font")
Now, this works if I set a Text Property to TestText:
Set(HelpVariable, 1);
Set(TestText2, "ScoringLabel" & HelpVariable & ".Text")
The text of the label is: ScoringLabel1.Text
But if I set the label's Font property to TestFont, I get the default font. Not the one in ScoringLabel1
If I check what is in "TestFont" it shows ScoringLabel1.Text with a Data type: text
Is the Data type wrong? Can I change it at all to do this?
If I can build property values like this, my apps will be amazingly dynamic.
The only other way I can think of doing it, is a nested IF statement, which, again: seems silly.
Any help is appreciated!
Solved! Go to Solution.
PowerApps does not allow us to make dynamic references in the way you describe. Unfortunately, references must be written out.
Set(HelpVariable, 1);
Set(TestFont2,
Switch(
HelpVariable,
1, ScoringLabel1.Font,
2, ScoringLabel2.Font,
3, ScoringLabel3.Font,
4, ScoringLabel4.Font,
5, ScoringLabel5.Font,
);
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
PowerApps does not allow us to make dynamic references in the way you describe. Unfortunately, references must be written out.
Set(HelpVariable, 1);
Set(TestFont2,
Switch(
HelpVariable,
1, ScoringLabel1.Font,
2, ScoringLabel2.Font,
3, ScoringLabel3.Font,
4, ScoringLabel4.Font,
5, ScoringLabel5.Font,
);
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
I think you are looking for something like an Eval() function.
But this is not available in PowerApps yet.
For your requirement though, can you use something like instead of trying to get the font type of a control?
Set(FontType,Font.'Dancing Script')
The Switch operator helped massively. It does not solve the issue, but it helps me. Thank you!
I managed to get what I needed done, but with a tonne of Switch and IF statements.
I love PowerApps, but I can't help but think it is an unfinished product the more I try to use it.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
200 | |
69 | |
50 | |
45 | |
20 |
User | Count |
---|---|
258 | |
121 | |
84 | |
79 | |
69 |