Hi,
I wanted to visually show an increase/decrease to a number week on week, by making something like the below:
Currently these numbers are generated by counting the number of rows in a certain column of a sharepoint list.
- I wondered if i could do this easily by counting the number of new records/rows created within the last X days and setting the visible properties to reflect that (eg if >0 then up arrow shows, if <0 (eg row deleted), down arrow shows). Is this possible? I thought I might be able to use the 'created date' auto generated by Sharepoint as the column to show if within the last x days or not?
Or is there a better way/not possible at all!
Thanks!
Solved! Go to Solution.
No problem at all. First, bookmark this link to Power Apps documentation - you will refer to this again and again.
In the OnVisible of your screen, you can put a value into that variable using this code:
If(Value(TextboxA.Text) >= 0,
UpdateContext({varUp:true}),
UpdateContext({varUp:false})
)
Note that code will only run as your app navigates to that screen. If that doesn't fit your app's logic, then find another property on a control/button that starts with "On" (these are behavior formulas) and put this code into it.
Also, the varUp variable is being used as a context variable here, so it is accessible only on the screen on which it is created. If you need to access this variable on more than one screen, use the Set() function instead of UpdateContext.
Hope that helps,
Bryan
You're on the right track here - control the visibility of those "up" and "down" arrows using app logic. I recommend using variables in those properties (e.g. varUp in one and !varUp in the other) and using Set() or UpdateContext() on those variables in a behavior field of your app such as OnVisible for the screen.
A CountRows() on a Filter() by specified dates of your Sharepoint list can be used to fill in your numerical values. You can use the Today() function with DateAdd() to craft the Filter expressions to fit the last seven days or whatever you need.
Hope that helps,
Bryan
Thanks @BCLS776 , I've got the date filter working, but i'm struggling with the variables (I've only be using powerapps for a couple weeks so lots of learning!)
I'm not sure how to set the UpdateContext bit in the OnVisible screen - I'm guessing it will need to have more logic so like if TextboxA has a value >=0 then VarUp = true, but not sure how to write this? Any suggestions or places i can go for more information?
Thanks again for your help!
No problem at all. First, bookmark this link to Power Apps documentation - you will refer to this again and again.
In the OnVisible of your screen, you can put a value into that variable using this code:
If(Value(TextboxA.Text) >= 0,
UpdateContext({varUp:true}),
UpdateContext({varUp:false})
)
Note that code will only run as your app navigates to that screen. If that doesn't fit your app's logic, then find another property on a control/button that starts with "On" (these are behavior formulas) and put this code into it.
Also, the varUp variable is being used as a context variable here, so it is accessible only on the screen on which it is created. If you need to access this variable on more than one screen, use the Set() function instead of UpdateContext.
Hope that helps,
Bryan
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
181 | |
137 | |
96 | |
83 |