Forum Discussion
Calculated Column Using Number Data to Return Different Values
- Oct 23, 2019Gotcha. I would create a new column in that case, use flow to process or loop through the list and update the column to the appropriate value, then add the logic to the button to record the value in the list going forward so you don't have to maintain a flow and powerapp and it'll make more sense if anyone needs to go edit it later.
Flow would be started using flow button (You can run it manually when ready to go from the flow editor)
Throw in a getitems action to get all items in list.
Update Item action using the getitems ID this will add it to a loop.
You can then put a condition in front of it to handle the shifts based on the calculated date, or if your feeling randy figure out how to use a flow expression and do it in a single step. This is basically like calculated column nesting if's to set the value in a single action instead of using conditions.
You could basically do this flow for a single item, once you get it working, then go back and and in the get items part and do the loop through.
Another tip, don't forget to go in and set paging or pagination? Something like that so it allows to pull more than 100 records in the loop. It's in the settings of the getItems action i believe.
ChrisWebbTechThanks for the reply! I tried this but it still returns shift 3 every time.
- Hayden_JenkinsOct 23, 2019Copper Contributor
ChrisWebbTechAh I see. Is there any way you can think of to get around this? I've got quite a bit of data in here and would prefer not to start from scratch. I have been collecting data for the date, but didn't know how to compare it because it includes date and time. Is there a way to do this?
- Oct 23, 2019A simple flow should be able to handle this. on Item Changed trigger, update item action and update that column's data.
You would need to Create a new column to store it, but flow could easily update it.
I guess I'm a bit confused where the powerapp comes into play here? I take it you are trying to filter data in the app and can't because of delegation on date field and trying to filter down to shift by using another column as integer?- Hayden_JenkinsOct 23, 2019Copper Contributor
ChrisWebbTechHmmm okay I'll take a crack at it with flow.
The powerapp is very simple. (one screen) it collects strings based on four buttons on the screen. Each time a button is pressed, it returns the appropriate string and creates a record in the sharepoint list. I then use this list to build a simple BI report off of it. I want to be able to filter data by shift, which means I need to be able to separate it by time of day. I figured since I can't compare the time using an IF statement, I'd need to convert the time to an integer and compare that way. I didn't realize I couldn't base one calculated column off of another, though.