cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kat_YESPrep
Frequent Visitor

Visible Based on Table

I have a gallery in which a label (RequiredItem) is visible based on validation. I would like an alert label on another page of the app to be visible if any items in the gallery have that label visible and the quantity (Orderquant) for that item in that gallery is empty/blank/0.

 

My current formula in the Visible property of the alert is:

 

If(And(RequiredItem.Visible=true,Orderquant.Text="0"),true,false)

 

I don't get any errors, but that label is visible for several items

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kat_YESPrep
Frequent Visitor

Hi there,

 

My app is essentially a shopping cart for school supplies. Some users must purchase certain items depending on their campus and the course.

 

I used complex logic to make the "Quantity" text input for those items in the gallery pink, as well as to make a "Required Item!" label visible.

 

The items added to the shopping cart are added to a collection. I added a "Req" column to this collection, which would read whether the "Required Item!" label was visible (true or false).

 

Then I created CountIf to count how many required items should exist for each campus/course scenario, and on the checkout page, counted the rows that included "Req="true"". If the checkout count was less than the gallery count, there would be a "Missing Required Item!" label on the checkout page, and if that "Missing Require Item!" label was visible (true or false based on the "Req" comparison/counts), the "Submit Order" button would also be disabled.

 

So, it took a bit, but this has been resolved. 🙂

View solution in original post

3 REPLIES 3
Eelman
Super User
Super User

@Kat_YESPrep 


A few screenshots of what you are attempting to do would help us help you, I'm finding it a little hard to imagine your process ... although that could just be low caffeine intake lol

 

A few things you could try though:

1. Split your conditions and try them one by one to see if either is the problem

2. Because you are checking for empty/blank/0 ( I assume all are possibilities?) try converting your order quantity to a number by multiplying by 1, ie

... Value(Orderquant.Text)*1=0 ...

3. On transition to the other screen set a variable that 'alert' can reference 

v-xida-msft
Community Support
Community Support

HI @Kat_YESPrep ,

Do you want to display the alert label in another screen when the RequiredItem Label is visible and the quantity value for that item is Blank?

 

Based on the formula that you mentioned, I think there is something wrong with it. As an alternative solution, please consider take a try with the following workaround:

Please consider apply the validation formula of the RequiredItem Label to the Text property of the RequiredItem Label rather than the Visible property. Set the Text property of the RequiredItem Label to following:

If(
   ThisItem.ColumnName = .... && ....,    // type your validation formula here
   ThisItem.ColumnName2,                 // if the validation is true, display the RequiredItem value
   Blank()                    // if the validation is false, display empty
)

Note: If the RequiredItem Label displays the text value, means that the RequiredItem Label is visible.

 

Then within your another screen, set the Visible property of the alert label to following:

If(
   !IsBlank(
           LookUp(Gallery1.AllItems, !IsBLank(RequiredItem.Text) &&  IsBlank(Orderquant.Text))
   ),
   true,
   false
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kat_YESPrep
Frequent Visitor

Hi there,

 

My app is essentially a shopping cart for school supplies. Some users must purchase certain items depending on their campus and the course.

 

I used complex logic to make the "Quantity" text input for those items in the gallery pink, as well as to make a "Required Item!" label visible.

 

The items added to the shopping cart are added to a collection. I added a "Req" column to this collection, which would read whether the "Required Item!" label was visible (true or false).

 

Then I created CountIf to count how many required items should exist for each campus/course scenario, and on the checkout page, counted the rows that included "Req="true"". If the checkout count was less than the gallery count, there would be a "Missing Required Item!" label on the checkout page, and if that "Missing Require Item!" label was visible (true or false based on the "Req" comparison/counts), the "Submit Order" button would also be disabled.

 

So, it took a bit, but this has been resolved. 🙂

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.

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 (4,011)