cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MostafaGamal
Helper IV
Helper IV

powerapps updating SharePoint list

Hi all, 

I use this formula to update a share point list and submit a form 

 

powerapps4.PNG

 

i want the button to filter the sharepoint list and update the fields of the row that contains the mail of the user who submit the button 

but it didnt work, please help 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @MostafaGamal ,

First(Filter()) and LookUp() are the same feather.

You could use this formula:

Patch(UsersBOS,LookUp(UsersBOS,MailOfUser=User().Email,IsBlank('No.OfEntreis')), {'No.OfEntreis':1,EntriesTime:Now()});Navigate(Screen2) 

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
KrishnaV
Community Champion
Community Champion

Hi @MostafaGamal ,

 

Try this:

 

Patch(OFSUsersList,First(Filter(OFSUsersList,Mail=User().Email)),{'BOS submitted':1,Date:Now()})

 

Note: in the I have noticed you are using Date as a filed name in Datasource "DATE" is a keyword should not use

 

I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 



I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a THUMS-UP and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

v-yutliu-msft
Community Support
Community Support

Hi @MostafaGamal ,

Could you tell me:

1)the data type of Mail field and 'BOS submitted' field?

2)what data do you want to update 'BOS submitted' field?

Please notice that: if  'BOS submitted' field is text type and you want to update with 1, then you just need to update with "1".

if  'BOS submitted' field is number type and you want to update with 1, then you just need to update with 1.

There's no need to use formula like "Number=1".

What's more, if Mail data type is text, then you could directly compare it with current user's email by using "=".

if Mail data type is person, then you need ti compare it with current user's email by using "Mail.Email".

 

So formula should be like this:
1)Mail is text type and 'BOS submitted' is text type:

Patch(OFSUsersList,First(Filter(OFSUsersList,Mail=User().Email)),{'BOS submitted':"1",Date:Now()})

 

2)Mail is text type and 'BOS submitted' is number type:

Patch(OFSUsersList,First(Filter(OFSUsersList,Mail=User().Email)),{'BOS submitted':1,Date:Now()})

 

3)Mail is person type and 'BOS submitted' is number type:

Patch(OFSUsersList,First(Filter(OFSUsersList,Mail.Email=User().Email)),{'BOS submitted':1,Date:Now()})

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@KrishnaV  thanks to your response, it works fine with this formula 

 

Patch(UsersBOS,First(Filter(UsersBOS,MailOfUser=User().Email)), {'No.OfEntreis':1,EntriesTime:Now()});Navigate(Screen2) 

 

but i want to make some modification to achieve my goal, in the SharePoint there are no. of rows that belongs to the user who will submit ( its like a users list for the app ), i want the formula to update the first blank row for the user by adding 1 and date , and when the user submit again it should update the next blank row by adding 1 and the date 

( every user have 30 rows ) 

 

powerapps6.PNG

@v-yutliu-msft   thanks to your response, it works fine with this formula 

 

 

Patch(UsersBOS,First(Filter(UsersBOS,MailOfUser=User().Email)), {'No.OfEntreis':1,EntriesTime:Now()});Navigate(Screen2) 

 

 

but i want to make some modification to achieve my goal, in the SharePoint there are no. of rows that belongs to the user who will submit ( its like a users list for the app ), i want the formula to update the first blank row for the user by adding 1 and date , and when the user submit again it should update the next blank row by adding 1 and the date 

( every user have 30 rows ) 

 

powerapps6.PNG

 

Hi @MostafaGamal ,

Do you want to:

 update the first blank row for the user at the first time?

 update the second blank row for the user at the second time?

If so, you need to filter blank item to update.

Try this formula:

Patch(UsersBOS,First(Filter(UsersBOS,MailOfUser=User().Email,IsBlank('No.OfEntreis'))), {'No.OfEntreis':1,EntriesTime:Now()});Navigate(Screen2) 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yutliu-msft your code is great but i was advised to use lookup() as my data in the SP is more than 60000 rows 

patch and filter will not be effective  

Hi @MostafaGamal ,

First(Filter()) and LookUp() are the same feather.

You could use this formula:

Patch(UsersBOS,LookUp(UsersBOS,MailOfUser=User().Email,IsBlank('No.OfEntreis')), {'No.OfEntreis':1,EntriesTime:Now()});Navigate(Screen2) 

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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,668)