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 / Visible button in form...
Power Apps
Answered

Visible button in form by using two datacard values

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

I need help with a problem I can't manage to solve on my own. I have a list of items, each with an unique ID, on numeric order (1, 2, 3..., n) and so I want it so the user always can edit item with id=1 (button edit in detail view), and in the edit view, when filling a camp with value "1", which marks it as 'finished', can edit the next item. Meaning, for example:

- Item with ID=1 and Finish=0 can always be edited.

- Item with ID=1 and Finish=1 can always be edited.

- Item with ID=2 can only be edited if ID=1 & Finish=1, otherwise can't see the edit button.

- Item with ID=3 can edit only if ID=2 & Finish=1.

And so on. The problem I found is that if I use something such as Text(DatacardValueXX), it will always be of the item I am seeing, so for example, with ID=2, Finish will always be zero.

lockIDCompleto.png

The formula seen above is:

If(Text(DataCardValue28)=Text(1),true,And(Text(DataCardValue28)<>Text(1),Text(DataCardValue29)=Text(1)),true,false)

What can I do? Or is it not possible at all?

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Don't try to work with the datacard values, instead work with the data.  

    In this case, your visible property on the button would be similar to this:

       If(ThisItem.ID=1, true,

          If(Lookup(yourDataSource, ID=ThisItem.ID-1).finishedField=1, true, false)

         )

     

    I hope that helps you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes 

    I am in a detail form, not sure if it might be due to that, but I can't use the "this item" option, as in, if I write it on the formula it doesn't show as suggestion, so am guessing I can't use it

     

    EDIT:
    I also tried adding a label in the gallery that would be invisible, and I used:

    ThisItem.Subtareas.ID

    Which is from the grouped gallery and the ID of the item. When I tried that, the label did not show any text/value, instead gave an error: "This property expects Text values, but this rule produces incompatible Table values"

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    If anyone knows a workaround, it would be greatly aprecciated

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    ThisItem is available in the Form.  You should be in the Form and using ThisItem.

     

    Is the button you are referring to inside or outside of the Form?  Upon review of the picture, it appears to be outside of the Form and up in the title bar.

     

    So, how is the Item property of your Form set?  That is what you would reference for the ID.

    Ex, if the Item is set to Galleryx.Selected then you can reference the same item for the ID - Galleryx.Selected.IDAnd so, your formula would be:

    If(Galleryx.Selected.ID=1, true, 
     If(Lookup(yourDataSource, ID=Galleryx.Selected.ID-1).finishedField=1, true, false)
     )

    So, basically, whatever is in your Item property should go into this formula.

     

     

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 421

#2
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 278 Super User 2026 Season 1

Last 30 days Overall leaderboard