cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mlaurie
Level: Powered On

SubmitForm if User is not in SharePoint datasource Created By column

Scenario: my company wants to new hire checklist in PowerApps that feeds back to a SharePoint list. To avoid two screens (one to create a new entry and one to edit an existing entry) I'd like to do something like this: 

 

Submit button looks to see if User ().fullname is in Created By column and if so patches/edits the existing checklist and if not the form is submitted as new. 

 

Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: SubmitForm if User is not in SharePoint datasource Created By column

Hi @mlaurie ,

Name is a fieldname that I use.

Please replace "name" with your fieldname that record employee's name

Save this as a collection

ClearCollect(collection1,Filter(New Hire Checklist,Not(name in Distinct(Filter(
New Hire Checklist,'Created By'.DisplayName in New Hire Checklist.name
),'Created By'.DisplayName
)
)
)
) //collection1 is the collection's name

 

If(name in collection1.name, Patch(New Hire Checklist,Defaults(New Hire Checklist),.....),
                             Patch(New Hire Checklist,LookUp(New Hire Checklist,name='Created By'.DisplayName),....)
)

 

Best regards,

Community Support Team _ Phoebe Liu

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

6 REPLIES 6
leyburn19
Level 10

Re: SubmitForm if User is not in SharePoint datasource Created By column

How many users and how many checklist rows are there?  This could be done with a foral statement,  but this puts you in the area of delegation restictions which is 500 Server side and can be extended to 2000 client side

Community Support Team
Community Support Team

Re: SubmitForm if User is not in SharePoint datasource Created By column

Hi @mlaurie ,

Do you want to filter items that name is not in list?

Try this formula: (collection1)

Filter(checklist,Not(name in Distinct(Filter(
listname,'Created By'.DisplayName in checklist.name
),'Created By'.DisplayName
)
)
)

You could use If statement to justify edit or create.

For example:

If(name in collection1.name, Patch(listname,Defaults(listname),.....);

                                              Patch(listname,LookUp(listname,name='Created By'.DisplayName),....)

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

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.
mlaurie
Level: Powered On

Re: SubmitForm if User is not in SharePoint datasource Created By column

The flow I created for archiving list items based on time will limit this number to approximately 200.

 


@leyburn19 wrote:

How many users and how many checklist rows are there?  This could be done with a foral statement,  but this puts you in the area of delegation restictions which is 500 Server side and can be extended to 2000 client side


 

mlaurie
Level: Powered On

Re: SubmitForm if User is not in SharePoint datasource Created By column

I'm sorry, I can see how this could work but struggle on how to implement it. My sharepoint list name is 'New Hire Checklist'. When you say "name in ..." what goes in the "name".

Community Support Team
Community Support Team

Re: SubmitForm if User is not in SharePoint datasource Created By column

Hi @mlaurie ,

Name is a fieldname that I use.

Please replace "name" with your fieldname that record employee's name

Save this as a collection

ClearCollect(collection1,Filter(New Hire Checklist,Not(name in Distinct(Filter(
New Hire Checklist,'Created By'.DisplayName in New Hire Checklist.name
),'Created By'.DisplayName
)
)
)
) //collection1 is the collection's name

 

If(name in collection1.name, Patch(New Hire Checklist,Defaults(New Hire Checklist),.....),
                             Patch(New Hire Checklist,LookUp(New Hire Checklist,name='Created By'.DisplayName),....)
)

 

Best regards,

Community Support Team _ Phoebe Liu

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

mlaurie
Level: Powered On

Re: SubmitForm if User is not in SharePoint datasource Created By column

Thank you for your explanation, I couldn't figure out in time and had to go another route. Thank you for all you do!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 177 members 5,319 guests
Please welcome our newest community members: