cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Black7830
Advocate I
Advocate 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
jannaj
Helper I
Helper I

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.

 

 

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.

jannaj
Helper I
Helper I

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

ScottShearer
Super User
Super User

@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

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

 

Joe

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

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

 

Joe

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
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



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. 

@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

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

 

@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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,787)