cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Canadiansal
Helper V
Helper V

Calculation

I have an SP List that has a column with "Week #" - this is a number column. So I might have a week number= 1 for example.

If there a way I can have a button in Powerapps that triggers an update to the week number? So I will like that when I click the button, the week number changes to 1+1 for example. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
ganeshsanap
Memorable Member
Memorable Member

@Canadiansal 

 

You can to this using Patch function. Set OnSelect property of button to:

 

 

Patch(SharePointListSource, ThisItem, {Week#: ThisItem.Week# + 1})

 

 

Use internal name of Week# column in formula.

 

If you are not using any gallery and want to update list item using it's ID then use:

 

Patch(SharePointListSource, {ID: 2}, { Week#: LookUp(SharePointListSource, ThisRecord.ID = 2, Week#) + 1 })

 

Here 2 is ID of SharePoint list item.

 

Check below references for more information: 

  1. Increment a SharePoint number column by 1 on button click 
  2. Patch function in Power Apps 

Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

View solution in original post

Hi@Canadiansal,

Could you please tell me more about your data configuration, is there only a Number column named 'Week#'?

Based on the issue that you mentioned, do you want to update the records related to the week 1?

If I understand correctly, I think the UpdateIf function could achieve your needs.

UpdateIf(SPlist,'Week#'=1,{'Week#':'Week#'+1})

Hope it could help you.

Regards,

Qi 

Best Regards,
Qi

View solution in original post

3 REPLIES 3
ganeshsanap
Memorable Member
Memorable Member

@Canadiansal 

 

You can to this using Patch function. Set OnSelect property of button to:

 

 

Patch(SharePointListSource, ThisItem, {Week#: ThisItem.Week# + 1})

 

 

Use internal name of Week# column in formula.

 

If you are not using any gallery and want to update list item using it's ID then use:

 

Patch(SharePointListSource, {ID: 2}, { Week#: LookUp(SharePointListSource, ThisRecord.ID = 2, Week#) + 1 })

 

Here 2 is ID of SharePoint list item.

 

Check below references for more information: 

  1. Increment a SharePoint number column by 1 on button click 
  2. Patch function in Power Apps 

Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

I should clarify.

So there will be multiple week values in the list. so there might be 1,2,3 etc., I will like for my button to only update the value in week 1 - not all the values.

Hi@Canadiansal,

Could you please tell me more about your data configuration, is there only a Number column named 'Week#'?

Based on the issue that you mentioned, do you want to update the records related to the week 1?

If I understand correctly, I think the UpdateIf function could achieve your needs.

UpdateIf(SPlist,'Week#'=1,{'Week#':'Week#'+1})

Hope it could help you.

Regards,

Qi 

Best Regards,
Qi

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,414)