cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelipeCaru
Level 8

Visible button in form by using two datacard values

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Visible button in form by using two datacard values

@FelipeCaru 

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.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: Visible button in form by using two datacard values

@FelipeCaru 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
FelipeCaru
Level 8

Re: Visible button in form by using two datacard values

@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"

FelipeCaru
Level 8

Re: Visible button in form by using two datacard values

If anyone knows a workaround, it would be greatly aprecciated

Super User
Super User

Re: Visible button in form by using two datacard values

@FelipeCaru 

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.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,796)