cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevinsray Helper III
Helper III

Set TextInpue Value from Collection

Hi,

Would really appreciate some help with a little process I am working on.

I have a NewVisitorsScreen where visitor enters details, name and phone number, then on click a button to Patch data to SQL table.

I am trying to put a process in where, if the user types in a phone number in the NewVisitorsScreen which already exists in the SQL table, it redirects to the ReturningVisitorScreen and populates a TextInput box which is setup as a search field.


I have a button in the NewV screen with a lookup to check if the phone number exists in SQL and enable the button if it does.

Then the onselect of the button creates the collection with the phone number, and navigates to the ReturningVisitorScreen

I can get the data I want from the NewVisitorsScreen into a collection, but not sure how to put that collection data into the search field on the Returning screen.


Any suggestions would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Set TextInpue Value from Collection

Hi kevinsray 

You could try the following:

 

Set the Default value of your search field to:

First(Collection).Phonenumber

 

This works if the collection only includes one row with the phone number, or if the phone number in the first row is the correct one.

 

If the collection includes multiple rows then you may need to filter it before you return the value.. Perhaps something like this, filter it so that the first phone number becomes the correct one:

 

First(
Filter(Collection, filtercondition1, filtercondition2)
       ).Phonenumber

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Re: Set TextInpue Value from Collection

Hi kevinsray 

You could try the following:

 

Set the Default value of your search field to:

First(Collection).Phonenumber

 

This works if the collection only includes one row with the phone number, or if the phone number in the first row is the correct one.

 

If the collection includes multiple rows then you may need to filter it before you return the value.. Perhaps something like this, filter it so that the first phone number becomes the correct one:

 

First(
Filter(Collection, filtercondition1, filtercondition2)
       ).Phonenumber

 

View solution in original post

kevinsray Helper III
Helper III

Re: Set TextInpue Value from Collection

DanielaH,

You are amazing.
Exactly what I wanted. Only took me a couple of days of searching to get the nerve up to post and kaboom, perfect answer straight away. Thank you so much.

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,353)