cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shabila97
Helper I
Helper I

Retrieve existing item SharePoint

I create an app where user fill in their passport number and connect it to SharePoint Online.

 

There is a button named RetrieveID to check either the passport number submitted is already existed previously or a new one (in SharePoint List)

 

My question is, how can I identify whether the passport number is already existed or a new one?

1 ACCEPTED SOLUTION

Accepted Solutions
R3dKap
Super User
Super User

Hi @shabila97,

Let's say that your datasource is named MyDataSource (a SharePoint list) and that you have a column in it named PassportNo.

Let's say you have a text field called txtPassportNo and a button called RetreiveID.

If you want to know if the passport number entered in the field txtPassportNo already exists in the SharePoint list when you click on the RetreiveID button, then you simply need to put the following formula in the OnSelect event of your button:

OnSelect = Set(boolPassportAlreadyExists,Not(IsBlank(LookUp(MyDataSource,PassportNo=txtPassportNo.Text))))

That way, the variable boolPassportAlreadyExists will be true if your passport already exists in your list.

Is this what you were looking for ?

Emmanuel

View solution in original post

2 REPLIES 2
R3dKap
Super User
Super User

Hi @shabila97,

Let's say that your datasource is named MyDataSource (a SharePoint list) and that you have a column in it named PassportNo.

Let's say you have a text field called txtPassportNo and a button called RetreiveID.

If you want to know if the passport number entered in the field txtPassportNo already exists in the SharePoint list when you click on the RetreiveID button, then you simply need to put the following formula in the OnSelect event of your button:

OnSelect = Set(boolPassportAlreadyExists,Not(IsBlank(LookUp(MyDataSource,PassportNo=txtPassportNo.Text))))

That way, the variable boolPassportAlreadyExists will be true if your passport already exists in your list.

Is this what you were looking for ?

Emmanuel

Hi Emmanuel,

 

This works fine for me. Thank you very much!!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,972)