cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
indhaa
Impactful Individual
Impactful Individual

IsMatch (collection and datacard)

Hi

 

So I have a combobox with External User info and when a user select a record it is added to the collection with a ClearCollect. 

My data card for FullName . Organization, Designation etc get updated with the selected records.

 

So when a user change any information in the data card, I want to update a label text to Update User. How do I use an Is(Match) between the value in the collection and the data card.

 

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Check FullName exists in the collection

 

Hi @indhaa 

If(DataCardValue73.Text in colExternalUser.FullName,"True","False")

 

Or

DataCardValue73.Text in colExternalUser.FullName

 

 

View solution in original post

5 REPLIES 5
StalinPonnusamy
Super User
Super User

Hi @indhaa

 

I believe you want to update the "External User" SP list information.

 

  • Have a combo box and set the items to 'External User'.FullName
  • Insert Edit Form on the screen
  • Set the "DataSource" property to 'External User'
  • Set the Item property to LookUp('External User', FullName=ComboBox1.Selected.FullName)
  • Submitform(FormName)

 

Note:

  • In this case, no need for the collection (I responded to another post without knowing full context 😀)
  • The form item can reference the combo box selection

 

Sample:

StalinPonnusamy_0-1630719755242.png

 

HI,

 

Thanks for the info. 

 

I can use that. Currently what I want to do was give the user the option to save or add users. Sometimes there might be one time users so in those cases they might not want to add the user to the SP list.

 

So I can add the SubmitForm() or Patch (I think better in this case) on a pop up message. In the label text I can say Add user (if a new user) or Update user (If there is any change to user info). That's why I want to use IsMatch to determine the text and if to Patch a new record or update a record.

 

So want to use IsMatch on a collection or the SP list to determine if it is a change and update the details if required.

But I'm having issue in getting the code right for Collection.

 

I'm using this code for the collection

 

IsMatch(collection.FullName,DataCardValue73.Text) 

 

or trying to use a Lookup field for the SP List and use IsMatch but no luck

 

Pls help

 

 

 

StalinPonnusamy
Super User
Super User

Hi @indhaa 

 

Need to check the SP list to see whether the user exists or not by checking the full name.

 

Your Save function will be

With (
    {
        _ExistingUser: LookUp(
            'External User',
            FullName = FullNameDataCard.Text
        )
    },
    Patch(
        'External User',
        If(
            IsEmpty(_ExistingUser),
            Defaults('External User'),
            _ExistingUser
        ),
        {
            FullName: FullNameDataCard.Text,
            Designation: DesignationDataCard.Text,
            Organization: OrganizationDataCard.Text
        }
    )
)

 

Note: Add User button/icon Onselect will be

NewForm(EditFormName);Reset(ComboBox1)

 

Hi,

 

I want to know about the IsMatch code to use if for Collection or if to check from SP List.

I'm having issues with that. Hope you are online now

 

 

StalinPonnusamy
Super User
Super User

Check FullName exists in the collection

 

Hi @indhaa 

If(DataCardValue73.Text in colExternalUser.FullName,"True","False")

 

Or

DataCardValue73.Text in colExternalUser.FullName

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,370)