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 / POWER APPS CUSTOM FORM...
Power Apps
Unanswered

POWER APPS CUSTOM FORM: How to have error message for field with enforced unique value?

(0) ShareShare
ReportReport
Posted on by 517

Dear Experts,

Good Day!

Kindly help me I have a  SP List form that I customized using Power Apps. I have a Transport Number field where in I turn on the enforced unique value in SP List column setting.

 

jaina_0-1651800896861.png 

jaina_1-1651800925195.png

 

I have an existing list item where the Transport Number is DE1K121212.

 

When I tried to create again new list item and input the same Transport Number DE1K121212, there is no error message displayed. It just not proceed with the submission.

 

How can I prompt the error message in custom form?

Categories:
I have the same question (0)
  • Verified answer
    jaina Profile Picture
    517 on at

    Update: Was able to resolve this.

     

    For anyone who has the same issue here's the resolution:

     

    Under Transport Number_Data Card:

     

    jaina_0-1651817871562.png

     

    1. I added a label named UniqueValue

    TEXT property formula:

    LookUp([SP LIST], [ColumnName] = [PowerApps_FieldName], true)

    jaina_1-1651817897536.png

     

    Output: This will return a true value whenever a Transport Number is already exist in your SP List, otherwise false.

     

    2. I added another label named UniqueValueError

    TEXT property formula:

    If(
    UniqueValue.Text = "true",
    "Transport Number already exist",
    ""
    )

    jaina_2-1651818085187.png

     

    Sample:

    jaina_3-1651818336677.png

     

  • alagator28 Profile Picture
    32 on at

    Thank you, this was exactly what I wanted to do but couldn't find a good solution. Yours was the simplest one and it worked like a charm.

    However, it only works when creating a new item. When I editing an existing item, the error is displayed when it shouldn't (at least in my case). Here is what I did to resolve this, although I'm sure there are simpler ways:

    First, I created two additional text labels:

    LabelID with text property: ThisItem.ID

    LookupID with text property: LookUp('Post-Mortem Tracker', Ticket = DataCardValue1.Text, ID)

     

    Finally, I edited the UniqueValueError formula as follows:

     

    If(

    And(

    UniqueTicketValue.Text = "true",

    Not(LookupID.Text = LabelID.Text)

    ),

    "Ticket number already exists. Please edit the existing entry instead.",
    ""
    )

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 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard