I have a SharePoint form that populates a SharePoint list. Is it possible to add a number to another number in a SharePoint list from a Microsoft Form?
@tvalenti If the SharePoint list contains a zero (and it's a number column) the expression should add the numbers together. However, if your MS Form response is empty—you'll get an error when you try to use the int() function. I'd recommend marking your questions required to avoid this.
You'll need to provide more insights to your workflow as you aren't giving me much to go on.
Thank you so much for your help!
Thank you so much for your help!! I got the form and SP list to add the two values correctly. However, if the SP list contained a zero, I was unable to get those two values to add together. In your opinion, I will have 8 people submitting numbers via the Microsoft Form. How would you set this up? I included my current flow and SP list. If there is an easier option, can I make some tweaks to my existing flow?
@tvalenti If you want to hardcode the SP ID, then you will need to use the Get Item action. The Get Items (plural) action returns an array of items. If you are only wanting to return a single item use the Get Item action. By using the Get Items action, Power Automate has automatically added an Apply to Each loop to loop through each item returned—this isn't what you want.
Delete the Get Items action and use a Get Item action instead. Pull your condition action outside of the Apply to Each action.
If the values in your SP list are stored in a number column, the int() function isn't required however the way that you've used it in the Compose action isn't correct—you need to use it in an expression. I would actually recommend removing the Update Item action for now—until you've confirmed that the output of the expression is as expected.
Numbers from a form question will need to be converted into a number using the int() function. Click on the dynamic content tab to insert the dynamic content form your MS form that contains your number response.
Run a test. The number should be green indicating it's an integer.
As mentioned before, if your SP list is storing a number (not a string of text) you can use a sub function to add the two numbers together. Important: Rename your actions to make it easier to identify which output dynamic content belongs to which Compose action.
Insert and expression and use the a sub() function. The add() function takes two numbers and adds them together.
add([number],[number])
Insert the dynamic content you'd like to add together, in my case, it's the output from the Compose action above and the number column from the SP list. This is why it's important to rename your actions—so you know which output belongs to which Compose action.
Make sure you add a comma to separate the two numbers. Click on the Dynamic Content tab and insert the appropriate dynamic content from your SP list. In my demo my number column in my list is CustomID. So I've inserted that.
Run a test. Review the output. You'll need to repeat this for each column you'd like to add an MS form value to.
Once you've done this, then you can add the Update Item action. For the ID field, you can insert the ID dynamic content from the Get Item action.
Insert the output dynamic content from the appropriate Compose action. Again, you'll need to do this for each of your columns that you are adding values to.
Hopefully, I am heading in the right direction. What would the formula look like to add the existing SharePoint Value with the new data submitted via the Microsoft Form? I do want to hardcode the SP ID, as that is connect to the email submitted by.
@tvalenti Are you planning to hardcode the SP ID? Or are you going to make it dynamic? If you are hardcoding the ID (which isn't recommended) then you can use the Get Item action to get the original SP item and return the values from that specific SP item.
However I wouldn't recommend hardcoding the ID. There should be some dynamic logic worked into your flow.
When the response is connected to a particular email, it updates the associated ID.
@tvalenti Sorry for the miscommunication. I was wondering how you are getting the SP ID from the user who is filling out the form? You are using the When a New Response is Submitted trigger for your flow.
Do you have a question in your form where the user (filling out the form) will enter a SP ID??... If not, how will you know which SP ID to use when the form has been filled out?
The first column of my SP list is the ID.
@tvalenti From the screenshot below it looks like you are manually entering in the ID of the SP item. Do you have a field in your MS Form that will allow the user to enter an ID?..
Can you provide some insight?
That is what I'm sure I am missing. How do I get the numbers from the SharePoint list?