cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CBI_Oshin
Level: Powered On

Search with a text box a look up value in a gallery

Hello there,

 

I am working with Dynamics 365 as a data source and I am trying to search a field in a gallery.

However the text label is:

 

LookUp('Event Bookings', 'Event Booking'= ThisItem.'Event Booking', 'Event Booking Name'

The gallery is connected to a table called 'Delegate' and when I do ThisItem.'Event Booking' it brings up a GUID. This is why I have to lookup the 'Event Bookings' data source. 

 

I cannot figure out how to get a text input box called BookerSearchNameInput to search/filter value.

 

Please can someone help me Smiley Happy 

 

14 REPLIES 14
Highlighted
Super User
Super User

Re: Search with a text box a look up value in a gallery

Hi @CBI_Oshin 

 

Can you try out below expression on the label inside your Gallery:
 
ThisItem.'Event Booking'.'Event Booking Name'

 

Hope this helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

CBI_Oshin
Level: Powered On

Re: Search with a text box a look up value in a gallery

Hi @yashag2255 

 

That doesn't work it brings up an error.

 

Is there way a way of searching a data source that is different to the one linked to the gallery?

Super User
Super User

Re: Search with a text box a look up value in a gallery

Hi @CBI_Oshin 

 

Can you please share more details about the error that you are getting? Can you try to add a temporary button in your gallery and put this expression on the OnSelect property: ClearCOllect(TestCollection,ThisItem.'Event Booking'). You can verify if this property is returning the lookup record that you are expecting. This button can be removed later.
 
Yes, filtering other data source inside the gallery item is possible. You can use LookUp/Filter/Search queries to do so.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
CBI_Oshin
Level: Powered On

Re: Search with a text box a look up value in a gallery

I am using Dynamic365 as a data source and ThisItem.'Event Booking' bring up a GUID. So I then have to do 

LookUp('Event Bookings', 'Event Booking'= ThisItem.'Event Booking', 'Event Booking Name')

'Event Bookings' is the other data source that the GUID data is stored so I have to lookup to the column. 

The lookup is working fine but I then don't know how to create a Search formula. The gallery is currently on the Delegate data source.

 

Super User
Super User

Re: Search with a text box a look up value in a gallery

Hi @CBI_Oshin 

 

You cannot carry out a search based on a formula that is added inside the Gallery control. 
 
Can you share the error details you got when you used the ThisItem.'Event Booking'.'Event Booking Name' formula in the value?
 
I carried out a test on my side and I can directly get the lookup field attribute using the filter statements. Similarly for searching the data based on a lookup value.
Expression used on the Gallery control:
Filter(Entity2S,StartsWith(LookupField.Name,"T"))
 
Here Entity2S is my CDS entity and a lookup field with Name "LookupField" to Entity1S is created in this case, I can simply filter the data based on Name column in the Entity1S using the above expression.MicrosoftTeams-image (175).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
CBI_Oshin
Level: Powered On

Re: Search with a text box a look up value in a gallery

The error I get is " invalid use of '.' "

Super User
Super User

Re: Search with a text box a look up value in a gallery

Hi @CBI_Oshin 

 

 
That might be because you have been referring to the wrong attribute in the filter formula, please select the attribute from the sugestion which is something similar to: 'LookupField (crce_LookupField)' 
 
Here, LookupField is the Display Name of my attribute and (crce_LookupField) contains the prefix added logical name of attribute.
 
This way the formula will be modified to: 
ThisItem.'Event Booking (crce_eventbooking)'.'Event Booking Name'
CBI_Oshin
Level: Powered On

Re: Search with a text box a look up value in a gallery

ThisItem.'Event Booking (cbi_EventBooking)'.'Event Booking Name'

This is great so the above works great.

 

So how can i search this with a text box? 

Search(, SearchDelegateNameinput.text, 'Event Booking (cbi_EventBooking)'.'Event Booking Name')

does that make any sense? I'm confused because the gallery is linked to the delegates data source, so can I search this with a text box?

Super User
Super User

Re: Search with a text box a look up value in a gallery

Hi @CBI_Oshin 

 

You can try the below expression:

Search(Delegate,SearchDelegateNameinput.text, 'Event Booking (cbi_EventBooking)'.'Event Booking Name')

This will return all the entries in delegate table where text input exists in event booking name column of the lookup attribute