cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter if both record exist

Hi,

I have two Issues:

 

1- I am using a filter condition to check if both record exist in my collection.
 collection (name: galleryColumn) has two value : Warning, Error

What i am trying is:

1-If warning exist 

2-If error exist

3-If both record exist

 

 

I have successfully managed to compare 1st two conditions but struggling on third one?

 

2- I am trying to open gallery on button select.

 

What I want is when a button is pressed, gallery should open with no selected item.

I want this because let say there are two items in gallery, one of the item has condition that if this record exist in the gallery the the input text box should appear.
Now, what happen is when gallery opens with two items, by default it opens with the first selected record and my condition doesn't succeed until I select that record.

 

 

Can someone please tell me how to compare these values successfully and to avoid selected item in gallery?

 

Regards.

Ahmad

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@Ahmad-KAISPE,

Could you please share a bit more about your scenario, how you configure your Gallery?

I think the three conditions in your first issue should adjust their order to determine.

In my scenario, I create a similar collection as below:

 

ClearCollect(GalleryColumn,{TestColumn:"Warning"},{TestColumn:"Error"})

 

To better validate all the three conditions, please try to modify your formula as below:

 

If(
    "Warning" in GalleryColumn.TestColumn && "Error" in GalleryColumn.TestColumn,
    "both exist.",
    "Warning" in GalleryColumn.TestColumn,
    "warning exsts.",
    "error exists."
)

 

For the second issue, do you want to click a button to avoid selecting an item from the Gallery?

Generally, the gallery select the first item by default. To achieve your needs, I think you could set a variable.

Add a Button and set the OnSelect property as below:

 

Set(GalleryVisible,true)

 

Set the Default property of the Gallery as below:

 

{}

 

Set the Visible property of the TextInput as below:

 

If("Warning" in Gallery1.Selected.TestColumn,true,false)

 

Note: After this, once you click the button, the Gallery will be visible and select nothing by default. Once you select a certain item, the TextInput will be visible.

Hope it could help.

Best Regards,

Qi

 

 

 

Best Regards,
Qi

View solution in original post

2 REPLIES 2
flugaoveltem
Resolver III
Resolver III

Hi @Anonymous 


If( (warning=true && error=true), true action, warning = true, true action, error = true, true action)

take a look in this video: 

https://www.youtube.com/watch?v=9aXP48XECDc

 

On your gallery solution, you can create a collection with OnSelect or skimpily hide a gallery with Visible property  

v-qiaqi-msft
Community Support
Community Support

Hi@Ahmad-KAISPE,

Could you please share a bit more about your scenario, how you configure your Gallery?

I think the three conditions in your first issue should adjust their order to determine.

In my scenario, I create a similar collection as below:

 

ClearCollect(GalleryColumn,{TestColumn:"Warning"},{TestColumn:"Error"})

 

To better validate all the three conditions, please try to modify your formula as below:

 

If(
    "Warning" in GalleryColumn.TestColumn && "Error" in GalleryColumn.TestColumn,
    "both exist.",
    "Warning" in GalleryColumn.TestColumn,
    "warning exsts.",
    "error exists."
)

 

For the second issue, do you want to click a button to avoid selecting an item from the Gallery?

Generally, the gallery select the first item by default. To achieve your needs, I think you could set a variable.

Add a Button and set the OnSelect property as below:

 

Set(GalleryVisible,true)

 

Set the Default property of the Gallery as below:

 

{}

 

Set the Visible property of the TextInput as below:

 

If("Warning" in Gallery1.Selected.TestColumn,true,false)

 

Note: After this, once you click the button, the Gallery will be visible and select nothing by default. Once you select a certain item, the TextInput will be visible.

Hope it could help.

Best Regards,

Qi

 

 

 

Best Regards,
Qi

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 (1,916)