cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Do a simple add expression to update an item

I need to add an item value from one SharePoint Online list to another but can't figure out how to do this since I'm unfamiliar with Expressions and have not been able to hunt down an example.

 

I want to Add List B number to List A number.  I'm assuming I have to use the expression add(Sumand_1:number, Sumand_2:number) in the List A field.  Is this correct?  If so what does it look like?  Is it  add(Sumand_1:List A number, Sumand_2:List B number)?

 

Also is there a site that provides examples of expressions?

 

Thanks,

Joe

12 REPLIES 12
Highlighted
Helper I
Helper I

Re: Do a simple add expression to update an item

Is this the doc you are looking for?

 

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#a...

 

There's a basic example provided.

 

 

Highlighted
Helper I
Helper I

Re: Do a simple add expression to update an item

Hi jannaj:

 

I'm trying to do a Flow that mimics a Sharepoint Designer workflow.  In Sharepoint Designer, you would set a variable to the value of the item in list B and then add that variable to value on the item in List A. Pretty simple once you set your conditions up.  The reason I'm not using a Workflow is because it is has not work consistently with SharePoint on line.  So I wanted to give it a try with a Flow.

 

The lack of documentation surronding parts of Flow is surprising.  Expressions is a good example.  "Power Users" are not going to use this capability when the documentation is geared towards Azure.

Highlighted
Helper I
Helper I

Re: Do a simple add expression to update an item

Joe - Flow for sure has a ways to go in terms of stability and documentation. Sorry the link didn't help. Best of luck to you - maybe someone else has some ideas?

 

- Janna

Highlighted
Super User III
Super User III

Re: Do a simple add expression to update an item

@Black7830- Here is an example that may help you.

 

I have a SharePoint list with a number column.  When an item in the list is created or changed, my Flow runs.

I initialize a variable and set it to the value stored in a column called NumberCol and add 10 using the Add expression.

 

In your case, you'll need to retrieve a row from List 2 and reference the value of a second number column in the expression.  You will likely be put into a loop but this shouln't be an issue as you should only be retrieving one row.

 

I then update a SharePoint columns by setting it equal to the variable.

 

AddNumbers.jpg

 

If this does not work for you, please provide additional details and I will enhance my example.

 

If this does solve your issue, please mark your post as solved.

 

Scott

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Helper I
Helper I

Re: Do a simple add expression to update an item

Hi Scott: Appreciate the assistance.  But where does Initialize Variable come from?  It is not a SharePoint Flow Action, Trigger or Expression.

 

Joe

Highlighted
Helper I
Helper I

Re: Do a simple add expression to update an item

Joe - it is an Action. And you have to initialize the variable before you can use it/set it.2018-07-09_15-35-17.gif

Highlighted
Helper I
Helper I

Re: Do a simple add expression to update an item

Thanks. Now I see it. I will give it a try.

 

Joe

Highlighted
Administrator
Administrator

Re: Do a simple add expression to update an item

Hello,  @Black7830!

Have you had an opportunity to apply @jannaj‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
Highlighted
Helper IV
Helper IV

Re: Do a simple add expression to update an item

did you get this working?  I'm doing simple action compose with add expression and cant get syntax right.  I get item to pickup a number and simply want to add 1 to it.  Have tried several things add([credit # sequential],1) and add('credit # sequential,1).  Nothing works. 

Highlighted
Super User III
Super User III

Re: Do a simple add expression to update an item

@dmclaughlin 

When you say it doesn't work, does it generate an error?  If so, what error?

Also, a screen shot of your expression would be very helpful.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Helper IV
Helper IV

Re: Do a simple add expression to update an item

My flow starts when 'credit request' entered.  I then get item 'credit number' sharepoint list which just had the last number in a doc. I then want to add to that field and update it in the credit number list and the credit request.  My issue is the add function.  I've tried add('Credit # increment',1) and says its a string.  I've tried add([credit # increment],1) and it says invalid syntax.  Tried below syntax also.  I just cant seem to get syntax right for the add expression.  thanks in advance

 

increment.JPG

 

Highlighted
Super User III
Super User III

Re: Do a simple add expression to update an item

@dmclaughlin 

Try converting the Credit # to a number before adding anything to it by using either the int() or float() expression.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (8,714)