web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If Lookup difficulty
Power Apps
Answered

If Lookup difficulty

(0) ShareShare
ReportReport
Posted on by 238

I'm trying to configure some buttons visibility properties around a formula, it's close but something isn't right, could do with someone advising please.


If(Value(LookUp(PurchaseOrdersUsers,Title=User().Email,Group4))>=2,"true","false")

This is working well.

I now want to change Group4 to be dynamic based on the selected item.

LookUp(PurchaseOrdersUsers,Title=User().Email,"Group"&(Gallery1.Selected.Supplier_Type))

Returns Group4 as its answer but when i copy this in place of Group4 it returns false, it should be true and visible.

If(Value(LookUp(PurchaseOrdersUsers,Title=User().Email,LookUp(PurchaseOrdersUsers,Title=User().Email,"Group"&(Gallery1.Selected.Supplier_Type))
))>=2,"true","false")

Or i though to try in place of Group4 to reference the "4" for that item in the gallery

If(Value(LookUp(PurchaseOrdersUsers,Title=User().Email,Group&Gallery1.Selected.Supplier_Type))>=2,"true","false")

this doesn't work either.

i think I'm fairly close, thanks in advance.








Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @PPSA ,

    You are trying to return a numeric value with a concatenated string - I suspect you may be trying to do something like this?

    Value(
     LookUp(
     PurchaseOrdersUsers,
     Title=User().Email &&
     YourSupplierTypeField=Gallery1.Selected.Supplier_Type
     ).Group
    )>=2

    You also do not need the If/true/false on the Visible property.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @PPSA ,

    Do you want to use dynamic value as field name in your lookup field?

    I'm afraid it's not supported in powerapps to do this.

    Please notice the syntax of Lookup function:

    LookUp(table,formula,fieldname)

    The third parameter fieldname should be a constant value.

    "Group"&(Gallery1.Selected.Supplier_Type  is variable, not constant value.

     

    To solve your issue, I suggest you use If statement to decide the fieldname in lookup field.

    For example:

    If(Value(LookUp(PurchaseOrdersUsers,
     Title=User().Email,
     If(Gallery1.Selected.Supplier_Type=1,Group1,
     Gallery1.Selected.Supplier_Type=2,Group2,
     Gallery1.Selected.Supplier_Type=3,Group3,
     Gallery1.Selected.Supplier_Type=4,Group4,
     Gallery1.Selected.Supplier_Type=5,Group5,....
    //fill in all the posibility of groupnum
     )
     ) 
     )>=2,true,false)

     

     

    Best regards,

  • PPSA Profile Picture
    238 on at

    This looks like what I'm trying to achieve yes but unfortunately still isn't working for me when trying what you have suggested so far.

  • PPSA Profile Picture
    238 on at

    @v-yutliu-msft 

    thank you, this worked in the end, i had to wrap 1,2,3 etc in "" as the supplier_type was text from SQL despite being a number.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard