Hey guys,
i'm drawing a blank. I thought I knew how to set and change variables, but it turns out I don't.
I'm working on an app to give people the chance to report a number and status (vertical slider hidden in front of the traffic lights). This is what my draft looks like.
I want to make buttons (arrows, +/- signs) change the variable to the left, which will then be taken
So I wrote this in "On Select" of the first little Up-Arrow
Set(varangemeldetbvjkneu; varangemeldetbvjkneu + 1)
The variables for the lower 4 numbers (the new ones to be filling in a form and then be submitted to an SP-list) are defined On Start:
Set(varanwesendbvjkneu; LookUp(Sort(BVJ_Schülerzahlen; Created; Descending); Direktorat = vardirektorat; BVJk_anwesend_gesamt));;
Set(varangemeldetbvjkneu; LookUp(Sort(BVJ_Schülerzahlen; Created; Descending); Direktorat = vardirektorat; BVJk_angemeldet_gesamt));;
Set(varanwesendbvjsneu; LookUp(Sort(BVJ_Schülerzahlen; Created; Descending); Direktorat = vardirektorat; BVJs_anwesend_gesamt));;
Set(varangemeldetbvjsneu; LookUp(Sort(BVJ_Schülerzahlen; Created; Descending); Direktorat = vardirektorat; BVJs_angemeldet_gesamt));;
If Ieave "On select" of the arrow blank, the label will show the value of the variable correctly.
If I type in the code above, it shows me an error and the label will stay empty
Solved! Go to Solution.
I figured it out.... The data type in the SP list was Text not Number, so the calculations did not work.
By the way, the traffic lights work nicely!
I figured it out.... The data type in the SP list was Text not Number, so the calculations did not work.
By the way, the traffic lights work nicely!
Thanks for sharing the answer @schwibach! Did you fix this by changing the data type of your SharePoint column to number?
That's exactly right, and then it worked automagically 🙂
Since you seemed to like some of the ease of some functions like the Switch function in your other post, I thought I might introduce you to the With function (if you're not already familiar) - another power function that helps cut down on the typing and troubleshooting.
With({_rekord: LookUp(Sort(BVJ_Schülerzahlen; Created; Descending); Direktorat = vardirektorat)};
Set(varanwesendbvjkneu; _rekord.BVJk_anwesend_gesamt);;
Set(varangemeldetbvjkneu; _rekord.BVJk_angemeldet_gesamt);;
Set(varanwesendbvjsneu; _rekord.BVJs_anwesend_gesamt);;
Set(varangemeldetbvjsneu; _rekord.BVJs_angemeldet_gesamt);;
)
Of course, technically, you could be just setting 1 variable to the actual record and then using any of its values rather than creating 4 variables. But that was not the point of my response.
Just mentioning With....enjoy!
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
260 | |
252 | |
85 | |
37 | |
33 |
User | Count |
---|---|
342 | |
264 | |
123 | |
73 | |
46 |