Forum Discussion
y2kardell
Feb 16, 2022Copper Contributor
Copy One Column to Another Column in the same SharePoint Item
Hello-
Maybe someone can help me with this scenario. I have a currency column (Column A) in a SharePoint item list that I would like to duplicate the values from Column A to Column B. I know that I can do this by creating a calculate field which works fine, but the other piece of the puzzle is that I need to have the total/sum displayed for Column B but being that Column B is a calculated field, the column does not give you the option to do so. Is there a script of any kind that will allow me to do that? I am really stumped at this part of the process and really needing to try to get this to work with my power automate flow.
Any and all help is appreciated,
y2kardell
7 Replies
Sort By
- RobElliottSilver Contributor
y2kardell you can do this with a simple flow in Power Automate as shown below. BUT first you MUST turn on item versioning in your list settings as the flow compares the current version to the previous one.
The expression in the Since field is:
sub(int(triggerOutputs()?['body/{VersionNumber}']),1)...and that is what compres the current version of the item with the previous one.
Next, add a condition and select Has Column Changed: Total (or whatever your column is called):
Leave the red if no channel empty and in the green if yes channel add a SharePoint update item action and in (in my case) the FlowTotal column I have selected the calculated Total column.
It will take a few seconds for the flow to run but the result is as shown below and the column total has been updated.
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)- tscaarpmsft944Copper ContributorThank you RobElliott, this worked very well.
- y2kardellCopper Contributor
RobElliott- I just realized that I was able to accomplish what you have by just adding a calculated field in one of the SharePoint columns, the issue I am having is that I need BOTH columns to display the total/sum. Any ideas?
Thanks again,
y2kardell- RobElliottSilver ContributorIt's not possible out-of-the-box to display the total of a calculated column. And you said this yourself in your first post. That's why I made the suggestion I did of using a separate column and a flow.