web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copy calculated column...
Power Automate
Unanswered

Copy calculated column value into another column causes infinity loop

(0) ShareShare
ReportReport
Posted on by 17

Hi,

I'm having a list of transactions with several columns where transactions are recorded in 5 columns. I then have a calculated column to sum all transactions for each line. Because calculated columns don't have totals at the end of the list or group I have then created another column and created a flow, which is supposed to look into the 5 transactions columns to see if they' have changed and then concates the calculated column value to the regular column, used for displaying totals.

 

For some reason the flow runs into infinity. I suppose it doesn't look into the specified columns but detected change in any column and after it is changed, this triggers another run.

 

I would like the most if the flow could run after a transaction has been added into one of the 5 transaction columns, so that the column with totals is up to date all the time. An alternative would be to create manually triggered flow that would copy all calculated amounts into the totals column but this is a less desirable option as data integrity is endangered.

 

Can anyone advise on how to configure the flow?

Categories:
I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @aljazd,

     

    You could use Get changes for an item or a file action to get the previous version of the edit item, if the Total column (calculate the five columns) has been changed is false from the previous version, sub the five items, or do nothing.

    add(int(triggerOutputs()?['body/{VersionNumber}']),-1)

    Screenshot 2020-10-16 152921.jpg

     

    Screenshot 2020-10-16 152959.jpg

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

  • aljazd Profile Picture
    17 on at

    Dear @v-litu-msft,

     

    thank you for your effort and reply! I have managed to follow your advice and it seems I got the flow to activate upon the change of an item. I can't however get it to populate or update the "auto sum" column. I thought this can be done by concate "calc sum" into "auto sum" function by this function:

     

    concat(triggerOutputs()?['body/sum_x0020_calc'])

     

    Screenshot_1.pngScreenshot_2.png

     

    Am I missing something?

     

    Thanks in advance!

  • v-litu-msft Profile Picture
    on at

    Hi @aljazd,

     

    The concat() function combine two or more strings, and return the combined string, it couldn't be used to sum up numbers.

    If you want to sum up the three members, you could use add() function.

    For example:

    add(triggerOutputs()?['column1'],triggerOutputs()?['column2'])

     

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

     

  • aljazd Profile Picture
    17 on at

    @v-litu-msft thank you for your reply!

     

    I am not sure if "concat" or "add" are the best-suited functions for my needs. Also, I couldn't get the flow to run past the condition, because the condition was set to COLUMN CHANGE = FALSE. After changing it to TRUE, and after modifying the "if yes" update action expressions into "add (payment 1,payment 2)", the flow ran properly.

     

    However, the problem I'm actually working on has 5 columns, that are first summed up into the calculated sum column, and I would like the flow to then simply copy this number in a new column, which would then be used for totals at the end of the list, just like on the screenshot below.

     

    Which function/formula would be the best for this?

     

    Screenshot_4.png

  • v-litu-msft Profile Picture
    on at

    Hi @aljazd,

     

    The add() function would be better. If the three columns are string type, you should use int() function to convert them into integer before use add() function.

    Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

     

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

  • aljazd Profile Picture
    17 on at

    Hey @v-litu-msft , thank you for a prompt response! All columns are integers, only the name column is a string type, there's no need for int(). Can add()work with more than two columns, something like add(column1, column2, columns3, column4, column5)?

     

    This would mean that I could abandon the sum column because PA would sum up each item's columns and totals at the end of the list/group would also work. The only problem is this doesn't happen instantly, because PA needs a few seconds to trigger and run.

  • v-litu-msft Profile Picture
    on at

    Hi @aljazd,

     

    Add() function only accept two properties, if the SharePoint list has three columns needs to sum, the expression should be:

    add(add(column1,column2),column3)

     

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard