cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Responsive Resident
Responsive Resident

Add two values and update item

Hi Community,
I need Flow to read the Total points from an Excel document that is generated from Forms quiz responses and then add this value to the current score for a user on a SharePoint list.
I'm able to list the items and also get the items from the SharePoint list but I'm not sure how to do the math within Flow to then update the SharePoint item.
Any ideas please?
Thanks,
CT

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Add two values and update item

Hi @CollabTechie, one way to do this - there might be more elegant ways - is shown below.

The overall flow looks like this and we'll then look act each component:

4-OverallFlow.png

I've manually triggered the flow then the first action is the Excel List rows present in a table.

Next add an Apply to each control, and for each value returned we add a SharePoint Get items action. But we only want to bring back the 1 item in our SharePoint list where the email address (in my Title column) is equal to the Email recorded on the form response. So add a filter query of Title eq '{Email}' where email is selected from the dynamic content. Making sure you put it inside single quotes.

0-trigger-listExcelRows-Apply.png

Next add another Apply to each control and select value from the Get items section of the dynamic content.

1-GetItems.png

Inside that apply to each add:

1) a Compose control to get the current total in the SharePoint column;

2) a Compose control to get the Total Points for the user from the form. You need to note that this is brought into the flow as text, not a number. So then;

3) add a Compose to turn it into an integer using the expression int(outputs('Compose_txtPointsToAdd'))

 2-ComposeCurrent-PointsToAdd.png

Next add another Compose control to do the addition. The expression is add(outputs('Compose_CurrentScore'),outputs('Compose_intPointsToAdd'))

Finally, add a SharePoint Update item action and in the Total column select the output from the Compose Addition.

3-Addition-UpdateItem.pngRob

Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

 

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: Add two values and update item

Hi @CollabTechie, one way to do this - there might be more elegant ways - is shown below.

The overall flow looks like this and we'll then look act each component:

4-OverallFlow.png

I've manually triggered the flow then the first action is the Excel List rows present in a table.

Next add an Apply to each control, and for each value returned we add a SharePoint Get items action. But we only want to bring back the 1 item in our SharePoint list where the email address (in my Title column) is equal to the Email recorded on the form response. So add a filter query of Title eq '{Email}' where email is selected from the dynamic content. Making sure you put it inside single quotes.

0-trigger-listExcelRows-Apply.png

Next add another Apply to each control and select value from the Get items section of the dynamic content.

1-GetItems.png

Inside that apply to each add:

1) a Compose control to get the current total in the SharePoint column;

2) a Compose control to get the Total Points for the user from the form. You need to note that this is brought into the flow as text, not a number. So then;

3) add a Compose to turn it into an integer using the expression int(outputs('Compose_txtPointsToAdd'))

 2-ComposeCurrent-PointsToAdd.png

Next add another Compose control to do the addition. The expression is add(outputs('Compose_CurrentScore'),outputs('Compose_intPointsToAdd'))

Finally, add a SharePoint Update item action and in the Total column select the output from the Compose Addition.

3-Addition-UpdateItem.pngRob

Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

 

View solution in original post

Highlighted
Responsive Resident
Responsive Resident

Re: Add two values and update item

Wow, thanks for the detailed response! I'm going to try this out right now and I will come back to you 🙂

Highlighted
Responsive Resident
Responsive Resident

Re: Add two values and update item

That worked perfectly, Rob. Ideally I would like to skip Excel but no dynamic content exists for score directly from Forms!

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

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

Users online (3,629)