Forum Discussion
Hayden_Jenkins
Oct 23, 2019Copper Contributor
Calculated Column Using Number Data to Return Different Values
Hi, I am trying to use a calculated column (that's using data from another calculated column) to return a string based on some simple conditions. Background: I have a powerapp that collects data ...
- 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.
Hayden_Jenkins
Oct 23, 2019Copper Contributor
ChrisWebbTechYeah, I could do that. Problem is, it's basically a kiosk that sits there all day and we've collected a ton of data so far that I can't change by modifying the powerapp. It's static data now.
Oct 23, 2019
Gotcha. 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.
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.
- Hayden_JenkinsOct 30, 2019Copper Contributor
ChrisWebbTechI am sure that would have worked and thank you for all your help. However, what I ended up doing was copying all the data I had into a new list, which made the time a static value instead of a calculated column. I then modified the app to record the time as an integer so all new entries would be able to be formatted. After this, I was able to accomplish what I needed. Thank you!