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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Want to add new Item i...
Power Apps
Unanswered

Want to add new Item in gallery Item (backend : Sharepoint List)

(0) ShareShare
ReportReport
Posted on by 51

Hello,

 

I want to add new item in powerapps gallery, but i want if particular item is already exists in gallery, then show error message you cant add new item, beacuse item is already exists.

Categories:
I have the same question (0)
  • Mike8 Profile Picture
    1,330 on at

    Hello,

    Can you use this as a reference?
    - Button1.OnSelect = ClearCollect(ColItems,{ItemName:"Item1"},{ItemName:"Item2"},{ItemName:"Item3"},{ItemName:"Item4"})
    - TextInput1 (to add new records)
    - Button2.OnSelect = If(LookUp(ColItems,ItemName=TextInput1.Text,true),
    Notify("The item "&TextInput1.Text&" already exists",NotificationType.Warning),
    Collect(ColItems,{ItemName:TextInput1.Text}))
    - Gallery1.Items = ColItems

    If you type Item5 in the TextInput1 and press Button2, you can see the item in the gallery. If you try to do the same you will see a warning message because Item5 already exists. Hope this helps

  • sachinsoni Profile Picture
    51 on at

    Hello Sir,

     

    That is my complete scenario.

    I have to column in sharepoint list first column type is person and second column type is person or group, I want when i submit the form, i want to check person already exists or not. both field type is person and group but first is only person.

     

     

    SachinQuery.jpg

  • Mike8 Profile Picture
    1,330 on at

    Hello Sir 🙂

    You can try to do a LookUp like this one:
    LookUp(ColItems,ItemName=TextInput1.Text,true)
    as a condition in an If statement.
    ColItems is the table you want to check if the new item exists 
    ItemName is the Column in the table you want to check if the new item exists 
    TextInput1.Text is the input of the user. The new Item that is about to be added or not
    true is returned if the condition ItemName=TextInput1.Text is met.
    Check the Button2.OnSelect expression and maybe try to recreate the example on the previous post. It can help you to find a solution for your issue 

  • sachinsoni Profile Picture
    51 on at

    Hello Sir..

     

    Please Checkerrorj.jpg

  • Mike8 Profile Picture
    1,330 on at

    Can you try if this works?


    If(LookUp(EmpAndApprover,Approver=DatacardValue11,true),
    Notify("The item "&DatacardValue11&" already exists",NotificationType.Warning),
    SubmitForm(Form2);Navigate(AdminDashboard,ScreenTransition.Fade);Refresh(EmpAndApprover))

  • sachinsoni Profile Picture
    51 on at

    Still facing error... Invalid argument type.

     

    sachin1.jpgsachin2.jpg

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard