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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Calculated Column in S...
Power Automate
Unanswered

Calculated Column in Sharepoint List with comma

(0) ShareShare
ReportReport
Posted on by 22

 Hi,

 

I have two Columns in SharePoint List called Value and Stock. 

 

Prob.jpg

 

Result column should be calculated using calculation column logic.

 

Values and Stock will always have the same number of commas. but there can be any number of commas.   So the solution should be smart enough to count number of commas and multiple value in right order.

 

Please how can I do this in Power Automate and pass it back to Sharepoint List?

 

Any help is much appreciated. I am new to Power Automate so please try to break it down.

 

Thanks a lot in advance.

Categories:
  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @MiltonK,

     

    I think this is achievable with a couple of supporting variables and split functions. 

     

    Below is an example of that approach.

     

    calculatestockagain.png

     

    1. Add a initialize variable, call it Count. Set the value to 0.

     

    inializevariablecount.png

     

    2. Add a second initialize variable of type integer, call it Result

     

    inializevariableresult.png

    3. Add a third initialize variable of type Array, call it ValueArray

     

    incrementvariablevaluearray.png

    4. Add a Get Items, Retrieve the Value stock items.

     

    getitemsvaluestock.png

     

    5. Add an apply to each. Use the value in the select an output from previous steps field.

     

    applytoeach_value.png

     

    6. Add a Set variable within the Apply to each action. Set the ValueArray variable by using this expression:

     

    split(items('Apply_to_each')?['Value'], ', ')

     

     

    setvariable_valuearray.png

     

    7. Add a second Apply to each action (calculate results), within the other Apply to each. Use the ValueArray variable for the select an output from previous steps field

     

    applytoeach_calculateresults.png

     

    8. Add an increment variable action with the second apply to each. Increment the Result variable by using the expression below.

    This expression uses a split function to get the separate values and uses the count variable to get the correct item via a variable index. It also a mul to multiply the value with the stock.

     

     

    mul(int(split(items('Apply_to_each')?['Value'], ', ')[variables('Count')]), int(split(items('Apply_to_each')?['Stock'], ', ')[variables('Count')]))

     

     

    incrementvariable_result.png 

     

    9. Add a second increment variable action. Increment the Count variable with 1.

     

    incrementvariable_count.png

     

    10. Place an update item action outside of the second apply to each action, but within the first apply to each action. Update the item with the result variable.

     

    updateitem_result.png

     

    11. Add a set variable action. Reset the Count with 0

     

    setvariable_resetcount.png

     

    12. Add a set variable action. Reset the Result with 0

     

    setvariable_resetresult.png

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard