I have added one pivot component from Creator Kit. I would like to set default selected item as first item(i.e Job Request View-Internal) . Below is the schema I am using in the items property of the pivot.
Table(
{
ItemKey: 1,
ItemDisplayName: "Job Request View-Internal"
},
{
ItemKey: 2,
ItemDisplayName: "KnowledgeBank Tracker"
},
{
ItemKey: 3,
ItemDisplayName: "Learning Program Tracker "
}
)
Can you confirm if this actually highlights the 'default' item or not. in my testing is still visually shows as being unselected.
Thanks bro you saved my day 🙂
Reviving a slightly older thread here. I had the same issue. It's a shame there just isn't more "stuff" out there yet about the Power Apps Creator Kit. This was the only post I could find on the subject of making a tab coming back to a default on page changes.
HVO, your solution came the closest for me, but I had a weird issue in that the first "click" after coming back to the page changed the tab, but not the selection border on the Pivot. I made some slight changes, following your lead.
On Screen Visible and Hidden, I set a variable to the tab I wanted as a default:
Set(varFormItemKey, "-Name of Default Tab-";
Then, in the OnChange of the Pivot Control, I set the variable to the ItemKey.
Set(varFormItemKey, Self.Selected.ItemKey);
That seems to do the trick for me. Coming back into the screen, the default Tab is set, but I can navigate through the other tabs fine as well.
When selecting a tab on the Pivot control, you would show or hide containers and/or controls based on the selected tab.
Tabs.Selected.ItemKey = "My Tab Key"
The way I handle setting the default tab is by setting the visible property of the container I want visible by default to true if the SelectedKey is blank.
If(IsBlank(Tabs.SelectedKey) Or Tabs.Selected.ItemKey = "defaultTabKey", true, false)
can any one help me how to set defaukt value in pivot
Within "Selected key" I use a variable:
If(IsBlankOrError(varFormItemKey),"",varFormItemKey)
When I navigate away from the page or to it, I set the variable with the value of the Item Key that I want as my default; whenever I select the other pivot items, I set the variable to Blank().
In which property is to be added this code?
I think you use this code
First(Self.Items)