cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ColinStar
New Member

Two Columns Unique when joined together within SharePoint

Hi All,

 

I am new to PowerApps development so I apologise if may request for help is obvious.

 

I have a SharePoint list where a project id is made up of two SharePoint columns.

Column01       Column02             Project_ID

Red                  UK                          Red-UK

Blue                 USA                        Blue-USA

Green              Australia                 Green-Australia

Red                 Canada                   Red-Canada

Yellow             USA                        Yellow-USA

 

My PowerApps has the two columns Column01 and Column02.

 

My question is how do I setup my PowerApps so when a user types in the two PowerApps text boxs for columns01 and column02 a check is done to make sure the text is unique when the two columns are joined together to create the Project ID within the SharePoint list?

 

Because I am new to PowerApps can you please go into detail or use screenshots.

 

I hope you can help.

Colin

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@ColinStar,

Based on the issue that you mentioned, do you want to check if there is an existing combination?

Could you please share a bit more about the scenario?

I have a similar test on my side, please take a try as below.

2021-02-23-01.png

Set the Default property of the TextInput corresponding to the Project-ID as below:

If(
    Concatenate(
        DataCardValue6.Text,
        "-",
        DataCardValue7.Text
    ) in Concat(
        Combined.Project_ID,
        Project_ID,
        "-"
    ),
    "You Have Duplicate Combination!",
    Concatenate(
        DataCardValue6.Text,
        "-",
        DataCardValue7.Text
    )
)

Note: DataCardValue6 and DataCardValue7 represent the TextInput corresponding to the Column01 and Column02.

Hope it could help you.

Regards,

Qi

Best Regards,
Qi

View solution in original post

2 REPLIES 2
James_McKie
Advocate II
Advocate II

I would suggest doing a Lookup on ProjectID to see if it already exists.  If no rows are returned then it's unique and can be added

v-qiaqi-msft
Community Support
Community Support

Hi@ColinStar,

Based on the issue that you mentioned, do you want to check if there is an existing combination?

Could you please share a bit more about the scenario?

I have a similar test on my side, please take a try as below.

2021-02-23-01.png

Set the Default property of the TextInput corresponding to the Project-ID as below:

If(
    Concatenate(
        DataCardValue6.Text,
        "-",
        DataCardValue7.Text
    ) in Concat(
        Combined.Project_ID,
        Project_ID,
        "-"
    ),
    "You Have Duplicate Combination!",
    Concatenate(
        DataCardValue6.Text,
        "-",
        DataCardValue7.Text
    )
)

Note: DataCardValue6 and DataCardValue7 represent the TextInput corresponding to the Column01 and Column02.

Hope it could help you.

Regards,

Qi

Best Regards,
Qi

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,911)