none
Copy the value of a calculated column via Designer workflow

    Question

  • I'm wondering if there is a way to copy the value of a calculated column and then via Designer workflow enter that value into another column in the same list.   When I try to do this, (using the Set Field in Current Item action) the workflow cancels, logging the following error -  "Coercion Failed: Unable to transform the input lookup data into the requested type." I suspect that this is because the workflow looks at the formula of the calculated column rather than its value and then sees this as a data mismatch with the column I am trying to write to (in this case a date or number data type).  Any thoughts on how to work around this?  Thanks!
    Saturday, July 14, 2012 9:08 PM

Answers

  • Hi WorkerBot,

    I can reproduce your issue.

    Because calculate column will return the string like: float;#2.00000000000000. If you want to copy it to a unmatched date type like a number field, it will throw such error.

    As a workaround, please copy the calculate column to a text column and get what exactly it is. Here I get “float;#2. 00000000000000”, and I only need 2. 00000000000000. Then I use the “Extract Substring from Index of String” action to copy the calculate column from the eighth char to the end of string, and the action output the string to Variable:substring. Then use set field in current item action to set my field with the value in variable: substring.

    Let me know if you have any question.

    Thanks & Regards,
    Emir


    Emir Liu

    TechNet Community Support

    • Marked as answer by WorkerBot Monday, July 16, 2012 6:31 PM
    Monday, July 16, 2012 11:06 AM

All replies

  • Hi WorkerBot,

    I can reproduce your issue.

    Because calculate column will return the string like: float;#2.00000000000000. If you want to copy it to a unmatched date type like a number field, it will throw such error.

    As a workaround, please copy the calculate column to a text column and get what exactly it is. Here I get “float;#2. 00000000000000”, and I only need 2. 00000000000000. Then I use the “Extract Substring from Index of String” action to copy the calculate column from the eighth char to the end of string, and the action output the string to Variable:substring. Then use set field in current item action to set my field with the value in variable: substring.

    Let me know if you have any question.

    Thanks & Regards,
    Emir


    Emir Liu

    TechNet Community Support

    • Marked as answer by WorkerBot Monday, July 16, 2012 6:31 PM
    Monday, July 16, 2012 11:06 AM
  • Emir,

    Your solution worked perfectly, thank you!

    Monday, July 16, 2012 6:32 PM
  • Can you provide the steps to do this functionality?
    Saturday, April 12, 2014 1:19 PM