web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / check if item exists i...
Power Apps
Unanswered

check if item exists if not create new using button to navigate to form

(0) ShareShare
ReportReport
Posted on by

So I have a button in my powerapp, when a user clicks on the button it should do a few things,

 

  1. Check if an item has been created in sharepoint list by user (only one entry in list per user)
  2. navigate to New/edit page depending on if item was found by user
  3. Set form to new if record does not exist by user, or  set form to edit of item already created by user.
  4. Save form as new record or update record that already exists.

for the button formula I have started with:

If(LookUp(SharePointList,Variable='Created By'.Email,"OK")<>"OK",Set(varCreatedBy,LastAddedItem.'Created By'.Email=varUser)&&NewForm(EditForm2) && Navigate(Screen2,ScreenTransition.Fade),EditForm(EditForm1))

 

This is formula is not accomplishing my desired above. I would appreciate any and all help!

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

    Put this code in the OnSelect property of your button.

    Set(recordID, LookUp(SharePointList,Variable='Created By'.Email, ID));
    If(IsBlank(recordID),NewForm(Form1), EditForm(EditForm1));
    Navigate(Screen2);

     

    Then use this code in the Item property of your form.

    LookUp(SharePointList,ID = recordID)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard