cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

filter gallery from SharePoint list has choice column

how to filter gallery in PowerApps from the SharePoint list which has Choice column. when i use the StartsWith function, it is not showing the Choice column, only Text columns are available to select. is there any workaround to overcome this issue.

2 ACCEPTED SOLUTIONS

Accepted Solutions
zmansuri
Super User
Super User

In your post you have said it's a choice column and in one of the reply you are saying it's a person type column. BOth are complex type column. And starts with only works on Text type column. For that you need to use AddColumns function in your gallery item code. For eg.

 

Filter(AddColumns(ListName,"NameTxt",'Name of individual to be released'.DisplayName),StartsWith(NameTxt,TextInput1.Text))

 

What above code does is add a column named "NameTxt" in you gallery source list at run time(No It doesn't effect your actual database). Now this added column holds DisplayName from your person type column. And now you can use Startswith Function on that column as you wished. I am adding a link. They are very useful fucntion.

 

https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-table-shaping

View solution in original post

cha_cha
Resident Rockstar
Resident Rockstar

Hello @Prabhu_Rajaram 

 

I think it's because you have added the column which modifies the structure of your Gallery items that is something different to your form on the side. Try using this:

 

 

Filter('Engagement Release Form',StartsWith('Name of individual to be released'.DisplayName,TextInput1.Text) || StartsWith('Name of Client',TextInput1.Text))

 

 

 


 ✔️
Just in case you think my answer helped you solve your problem, please mark/accept this as a SOLUTION.   This helps community members if they experience a similar issue in the future.

 

 🔗
  🕸  bistek.space  🐦 @cha_bistek  📺  @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

View solution in original post

9 REPLIES 9
cha_cha
Resident Rockstar
Resident Rockstar

Hello @Prabhu_Rajaram 

 

Can you please help me understand your solution by sending details/screenshots of your SharePoint lists and the screen of your PowerApps? that would help me provide you a better solution


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

below is the column i have in SharePoint, where "Name of individual to be released" is type of Person or Group.

Prabhu_Rajaram_0-1670039917586.png

i have 2 screens in PowerApps, "UserScreen" and "EditScreen". In Userscreen, user will submit the form by selecting the name from dropdown on "Name of individual..." field.

in EditScreen, i have gallery linked with this Sharepoint list, i have to filter gallery from search text box by the "Name..."

Prabhu_Rajaram_1-1670040175663.png

i use Startswith function to filter the gallery, but it is not showing this particular field to search. 

StartsWith('Name of individual to be released',TextInput1.Text)

zmansuri
Super User
Super User

In your post you have said it's a choice column and in one of the reply you are saying it's a person type column. BOth are complex type column. And starts with only works on Text type column. For that you need to use AddColumns function in your gallery item code. For eg.

 

Filter(AddColumns(ListName,"NameTxt",'Name of individual to be released'.DisplayName),StartsWith(NameTxt,TextInput1.Text))

 

What above code does is add a column named "NameTxt" in you gallery source list at run time(No It doesn't effect your actual database). Now this added column holds DisplayName from your person type column. And now you can use Startswith Function on that column as you wished. I am adding a link. They are very useful fucntion.

 

https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-table-shaping

cha_cha
Resident Rockstar
Resident Rockstar

Hello @Prabhu_Rajaram 

 

EDIT: the answer of @zmansuri is also right.

This would be the code:

 

 

Filter('Name_of_your_list',StartsWith('Name of individual to be released'.DisplayName,TextInput1.Text))

 

 

 

Another way of doing it would be using Search just in case you want to search the middle parts of the name.

 

 

Search(AddColumns('Name_of_your_list',"namereleaseto",'Name of individual to be released'.DisplayName),TextInput1.Text,"namereleaseto")

 

 

 

 


 ✔️
Just in case you think my answer helped you solve your problem, please mark/accept this as a SOLUTION.   This helps community members if they experience a similar issue in the future.

 

 🔗
  🕸  bistek.space  🐦 @cha_bistek  📺  @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
cha_cha
Resident Rockstar
Resident Rockstar

Hello @Prabhu_Rajaram 

 

This would be the code:

 

Filter('Name_of_your_list',StartsWith('Name of individual to be released'.DisplayName,TextInput1.Text))

 

 

Another way of doing it would be using Search just in case you want to search the middle parts of the name.

 

Search(AddColumns('Name_of_your_list',"namereleaseto",'Name of individual to be released'.DisplayName),TextInput1.Text,"namereleaseto")

 

 

 


 ✔️
Just in case you think my answer helped you solve your problem, please mark/accept this as a SOLUTION.   This helps community members if they experience a similar issue in the future.

 

 🔗
  🕸  bistek.space  🐦 @cha_bistek  📺  @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

awesome, this works really well. thank you so much!!!

hi Zmansuri, the above function is working fine to filter in gallery, but it looks there is another issue comes now. in preview mode Form is not loading as per gallery selection.

Prabhu_Rajaram_0-1670048840454.png

I have applied Item property as Gallery1.Selected (it's a Gallery name).

Below is the Items Property i used in Item Property to filter the gallery.

Prabhu_Rajaram_1-1670048954675.png

 

cha_cha
Resident Rockstar
Resident Rockstar

Hello @Prabhu_Rajaram 

 

I think it's because you have added the column which modifies the structure of your Gallery items that is something different to your form on the side. Try using this:

 

 

Filter('Engagement Release Form',StartsWith('Name of individual to be released'.DisplayName,TextInput1.Text) || StartsWith('Name of Client',TextInput1.Text))

 

 

 


 ✔️
Just in case you think my answer helped you solve your problem, please mark/accept this as a SOLUTION.   This helps community members if they experience a similar issue in the future.

 

 🔗
  🕸  bistek.space  🐦 @cha_bistek  📺  @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

wow great, it works really well!!! thank you so much.

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.

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,170)