cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DS1
Frequent Visitor

Want to use Flow to copy data from one list column to another SharePoint Online

I have a SharePoint Online List with a calculated (number) column. This column is called Week End. There is another column in this list (number) called SUM. I would like when something is entered into "Week End" that that same value be copied in "SUM."

 

I have checked these documents: https://docs.microsoft.com/en-us/flow/odata-filters and here: https://flow.microsoft.com/en-us/blog/copying-using-filtering/

 

Where I am getting hung up is in the "Get Items" step of the Flow:
SUM.png
When I have the source, "Week End" equalling the target "SUM" I get errors. 
Also, in the conditional "Create Item" or "Update item," I should have SUM entered as so? I much appreciate your help!
SUM2.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi DS1,

 

Yes, it is because that the “Week End” column is a calculated column. The return value of this column is of text type.


While Sum is of type Number. So the dynamic content of Week End won’t be available for the Sum field.


Please consider using workflow definition language to convert “Week End” to a number type, you may try to use int function.


I have made a simple test on my side, “test11” is a calculated column, I use int function convert it to a number first, then select output of the Compose action for the Number field.


It works expected.

3.PNG

More details about workflow definition language, please check it at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

DS1
Frequent Visitor

NOTE: This solution results in a "Loop" and the Flow will run thousands of times, constantly updating. The link to the solution can be found here:
https://powerusers.microsoft.com/t5/General-Flow-Discussion/Flow-running-thousands-of-times-on-SP-qu...

 

 

View solution in original post

10 REPLIES 10
v-yamao-msft
Community Support
Community Support

Hi DS1,

 

I am not sure with your scenario. Could you show me more details about your scenario?


You said that “I would like when something is entered into "Week End" that that same value be copied in "SUM"”, my understanding is that you want to enter the same value to SUM when it is entered into the “Week End” column. But I am not sure why you are using the action “Get items”.


When using the action “Create item” or “Update item”, you need to specify the value that you want to enter into the column for the Sum field.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
efialttes
Super User
Super User

Hi DS1

Not sure I understood the scenario either. I guess I would select "When an item is updated" item from SP connector, then simply add Update item action block, select Item ID comming from the trigger; and ensure you copy in "Sum" the value coming from the trigger on "Week End". The main problem with this approach is that the flow will be triggered again and again (please see the following thread explaining this issue: https://powerusers.microsoft.com/t5/Building-Flows/Flow-update-to-SharePoint-list-item-fields-trigge... ). Depending of your needs you can delete the item instead and create a new one with the same values received through the trigger but "Sum", that would be a copy of "Week End". Please note with this dirty trick you are losing valuable info like Who created the item and when, etc.

Hope this helps

 

 

 


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



DS1
Frequent Visitor

Hi there, I have one list and am hoping that when a value gets added to the column Week End that I can then copy it to the column SUM. Maybe I should not be using Get Items? Here is my Flow:

Flow1.pngFlow2.png

DS1
Frequent Visitor

HI Mabel, yes that is correct: You said that “I would like when something is entered into "Week End" that that same value be copied in "SUM"”, my understanding is that you want to enter the same value to SUM when it is entered into the “Week End” column.

 

Thank you for your help

v-yamao-msft
Community Support
Community Support

Hi @DS1,

 

Please try to use the action “Update item”. You could use the dynamic content of the “Week End” column for the Sum field.


Then when the item is created/modified, the value in the “Weed End” column will be copied to the “Sum” column.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DS1
Frequent Visitor

Hi Mabel:

Thank you very much. I have tried this out, and when a value is added into the calculated column "Week End" the same value is not added into the column in the same list "SUM." Here is my Flow with the "Update Item":
Flow1.pngFlow2.pngFlow3.png
Note above that in the SUM field, "Week End" does not show as an option in the Dynamic Content. Is this because "Week End" is a calculated column? Is there any other way to get it so that when a value is created in "Week End" that the same value be copied to "SUM"
Much thanks for your help, really appreciate it.

v-yamao-msft
Community Support
Community Support

Hi DS1,

 

Yes, it is because that the “Week End” column is a calculated column. The return value of this column is of text type.


While Sum is of type Number. So the dynamic content of Week End won’t be available for the Sum field.


Please consider using workflow definition language to convert “Week End” to a number type, you may try to use int function.


I have made a simple test on my side, “test11” is a calculated column, I use int function convert it to a number first, then select output of the Compose action for the Number field.


It works expected.

3.PNG

More details about workflow definition language, please check it at here:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

DS1
Frequent Visitor

Mabel, thank you so much for this solution, we much appreciate it! This worked for us.

DS1
Frequent Visitor

NOTE: This solution results in a "Loop" and the Flow will run thousands of times, constantly updating. The link to the solution can be found here:
https://powerusers.microsoft.com/t5/General-Flow-Discussion/Flow-running-thousands-of-times-on-SP-qu...

 

 

View solution in original post

Reytheo
Regular Visitor

I've tried to apply the same solution without success. My flow fails at the Compose stage.

 

The error message is the:

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2377': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

 

I'm trying to copy a calculated field Auditscore1 to a number field Auditscore2.

 

What I have in Compose inputs is : int(triggerBody()?['AuditScore1']).

 

Can you help me?

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,855)