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

Hiding tabs based on Satus column

Hi,

I've got a muti part form, which consist of tabs Parts B to F, but a user will only ever complete 1 part, i.e. Part B.

I'm trying to hide tabs on my form when the status column for example is 'Part B Complete', so I'd like Part C, Part D etc. tabs to not be visible when a user is viewing a partially completed form.

On the App OnStart I've set this and works and takes the user to Part B:

If(VarRecord.Status.Value= "Part B Complete",Navigate(OldScreen) && Set(VarTab, "PartB"))

On the Visible property of say 'Part C' tab I'm looking to use something like this, but cant get the syntax right:

VarTab !"Part B" || VarTab, !"Part D"

by stating if its not Part B, Part D, etc then Part C is visible

 

 

 

9 REPLIES 9
Super User
Super User

Re: Hiding tabs based on Satus column

@G99 

Your original approach was to make the tab for "Part C" Visible when varTab is not equal to "Part B"  or "Part C"

VarTab !"Part B" || VarTab, !"Part D"

 

My suggestion would be to use this code in the Visible property when you need to see Part C.

VarTab = "Part C"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

G99
Level 8

Re: Hiding tabs based on Satus column

Hi @mdevaney 

Thanks and that works, but I've realised, that I'll have gaps on my form. So say Part C is selected, that will be in the middle of the page, or Part F will be to the right of the page.

 

I think I need to disable the tabs based on the status column, so if Part B Complete, i'll need to set the displaymode of the other tabs to be disabled

Super User
Super User

Re: Hiding tabs based on Satus column

@G99 

Sure, then just use code like this in the DisplayMode property

If(varTab = "Part B", DisplayMode.Edit, DisplayMode.Disabled)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

G99
Level 8

Re: Hiding tabs based on Satus column

@mdevaney 

 

I thought something like this on the displaymode of Part C button:

 

If(And(DataCardValue63.Selected.Value = "Part C Complete", VarTab = "Part C", DisplayMode.Edit,DisplayMode.Disabled)

 

But i'm not quiet there with the syntax

Slaverty
Level: Powered On

Re: Hiding tabs based on Satus column

May be mis-understanding here, but I think sticking a formula like the following would also solve the gaps problem.

 

height = If(FormB.Visible, 300, 0)

width = If(FormB.Visible, 300, 0)

 

Essentially, if the object is visible, set to it's normal dimensions, otherwise set it's height and width to 0.  Assuming your form's X and Y positions are based off the other form positions, this would eliminate the gaps when certain forms are invisible.

Or could do the same with the form's X & Y positions and leave the height and widths as is.

 

EDIT:

For your above syntax, think you're just missing a bracket

If(And(DataCardValue63.Selected.Value = "Part C Complete", VarTab = "Part C"), DisplayMode.Edit, DisplayMode.Disabled)

G99
Level 8

Re: Hiding tabs based on Satus column

@Slaverty @mdevaney 

 

I can't get it to work, not the way I want

 

I have 5 tabs

DisplayMode is set to:

If(VarTab = "Part B", DisplayMode.Disabled, DisplayMode.Edit)

OnSelect:

Set(VarTab, "Part B")

 

If Part B is selected a bunch of fields show up, else they dont... I need to add another condition to this and say if Part B is selected the other fields need to be disabled

 

@Slaverty 

In regards to your suggestion about changing the position, I will give that a try, although currently I'm aligning all my tabs using the Y property and the first tab

Slaverty
Level: Powered On

Re: Hiding tabs based on Satus column

Some pictures would help me visualise what you're trying to achieve, but based off last message, do you have your DisplayMode properties for your tabs exactly the same? (ie If(VarTab = "Part B", DisplayMode.Disabled, DisplayMode.Edit))

 

I would expect Tab B  to have 

If(VarTab = "Part B", DisplayMode.Edit, DisplayMode.Disabled) (switched round true/false actions)

Tab C to have 

If(VarTab = "Part C", DisplayMode.Edit, DisplayMode.Disabled)

And Tab D

If(VarTab = "Part D", DisplayMode.Edit, DisplayMode.Disabled)

Ect ect

That way, the value of VarTab would allow only one tab to be in DisplayMode.Edit, the rest would be disabled.

G99
Level 8

Re: Hiding tabs based on Satus column

@Slaverty 

 

Thats correct all the tabs have the exact same, bar Part 'B', Part 'C' etc. and the thinking behind that is, if a user clicks on the tab, i.e. Part B, its then disabled, as no point a user clicking on it again.

 

If i switch it around, and change all the fx for each field, it doesnt achieve my goal of disabling all the other tabs.

 

I thought the best way was to use the status column to determine what tab should be active as this is a view screen and not an edit screen?

Super User
Super User

Re: Hiding tabs based on Satus column

@G99 

My usual pattern for creating a tabbed form is this:

 

You can use a single screen and show/hide datacards when the user clicks a button to goto the next section.  It will appear like there are multiple screens but there aren't.  An advantage of doing things this way is your only have to submit the form once.

 

Put this code in the OnVisible property of your screen

Set(currentTab,"A")

 

Then for every datacard you want showing on tab "A" you must put this code in the visible property.  For any datacards showing on other screens use the appropriate tab letter.

currentTab="A"

 

Create a button to browse to the next page with the following properties.  We will say for this example there are 3 screens.

Text: "B"
OnSelect: Set(currentTab, "B")
Text: "C"
OnSelect: Set(currentTab, "C")
Text: "D"
OnSelect: Set(currentTab, "D")

 

Finally create a button to Submit the form with the following properties

Text: "Submit Form"
OnSelect: SubmitForm(your_form_name_here)

 

Let me know if you have questions.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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 (10,379)