Hi,
So I created a Kanban Board. However, I am stuck on how gallery can move to another lane.
So when you check the checkbox and then click the arrow, the gallery can move from one lane to another (Created to Ready)
I know I have to Patch it but I am stuck on the highlighted code.
Can anyone help me with this? Thank you!
Regards,
May
Solved! Go to Solution.
So, this is part of a larger context, meaning that there are a lot more aspects of your app that are needed to be known.
I have used this in similar apps before and it is fairly straight forward.
One of the keys (and I am noticing you have another post related to this) is to have an "Order" value associated with the Status.
What we do in the app:
1) There is a Horizontal Gallery. The Items for that Gallery is set to all of the Statuses sorted by the "Order".
Within the horizontal gallery is a Label that populates with the name of that status. (note: we usually have a color associated with each status record as well and use that to fill the label)
2) The Horizontal Gallery has a Vertical Gallery nested in it. The Items of that gallery are set to Filter(myDataSource, Status=ThisItem.Status)
In the vertical gallery are labels and such to display relevant information along with a CheckBox to indicate selection for "lane change"
3) Now, to get the items to move on the left or right click, there is a Label in the Horizontal Gallery (it is not visible). The text property of the Label is set to Concat(Filter(theVerticalGallery.AllItems, theCheckbox.Value), ID & ";") (Note: all of the records in the galleries have an ID)
This will give a concatenated list of all of the "checked" items in the Gallery.
To get the combined list from all of the "lanes", there is a Label (also not visible) outside of the Galleries. Its Text property is set to Concat(theHorizontalGallery.AllItems, theHiddenLabelMentionedAbove.Text)
This will then contain a concatenated list of all the Lanes.
4) Now...always hating to repeat a formula in two places:
A) The Left Icon has the following in the OnSelect : UpdateContext({lclMoveLanes:"Left"})
B) The Right Icon has the following in the OnSelect : UpdateContext({lclMoveLanes:"Right"})
C) There is then a Toggle control on the screen (also hidden) that has the following:
Default property : !IsBlank(lclMoveLanes)
OnCheck Action:
ForAll(Split(combinedLabelOutsideOfGallery.Text, ";"),
With({itm: LookUp(myDataSource, ID=Value(Result))},
With({statOrder:LookUp(myStatusList, val=itm.Status, order)},
With({newOrder:
Switch(lclMoveLanes,
"Left", If(statOrder>1, statOrder-1, statOrder),
"Right", If(statOrder<CountRows(myStatusList), statOrder+1, statOrder)
)},
UpdateIf(myDataSource, ID=Value(Result),
{Status: LookUp(myStatusList, order=newOrder, val)}
)
)
)
)
);
UpdateContext({lclMoveLanes:Blank()})
This will then move all selected items to either the right or left depending on which direction is pressed.
Works like a charm!
I hope this is relatively clear and helpful for you.
So, this is part of a larger context, meaning that there are a lot more aspects of your app that are needed to be known.
I have used this in similar apps before and it is fairly straight forward.
One of the keys (and I am noticing you have another post related to this) is to have an "Order" value associated with the Status.
What we do in the app:
1) There is a Horizontal Gallery. The Items for that Gallery is set to all of the Statuses sorted by the "Order".
Within the horizontal gallery is a Label that populates with the name of that status. (note: we usually have a color associated with each status record as well and use that to fill the label)
2) The Horizontal Gallery has a Vertical Gallery nested in it. The Items of that gallery are set to Filter(myDataSource, Status=ThisItem.Status)
In the vertical gallery are labels and such to display relevant information along with a CheckBox to indicate selection for "lane change"
3) Now, to get the items to move on the left or right click, there is a Label in the Horizontal Gallery (it is not visible). The text property of the Label is set to Concat(Filter(theVerticalGallery.AllItems, theCheckbox.Value), ID & ";") (Note: all of the records in the galleries have an ID)
This will give a concatenated list of all of the "checked" items in the Gallery.
To get the combined list from all of the "lanes", there is a Label (also not visible) outside of the Galleries. Its Text property is set to Concat(theHorizontalGallery.AllItems, theHiddenLabelMentionedAbove.Text)
This will then contain a concatenated list of all the Lanes.
4) Now...always hating to repeat a formula in two places:
A) The Left Icon has the following in the OnSelect : UpdateContext({lclMoveLanes:"Left"})
B) The Right Icon has the following in the OnSelect : UpdateContext({lclMoveLanes:"Right"})
C) There is then a Toggle control on the screen (also hidden) that has the following:
Default property : !IsBlank(lclMoveLanes)
OnCheck Action:
ForAll(Split(combinedLabelOutsideOfGallery.Text, ";"),
With({itm: LookUp(myDataSource, ID=Value(Result))},
With({statOrder:LookUp(myStatusList, val=itm.Status, order)},
With({newOrder:
Switch(lclMoveLanes,
"Left", If(statOrder>1, statOrder-1, statOrder),
"Right", If(statOrder<CountRows(myStatusList), statOrder+1, statOrder)
)},
UpdateIf(myDataSource, ID=Value(Result),
{Status: LookUp(myStatusList, order=newOrder, val)}
)
)
)
)
);
UpdateContext({lclMoveLanes:Blank()})
This will then move all selected items to either the right or left depending on which direction is pressed.
Works like a charm!
I hope this is relatively clear and helpful for you.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
161 | |
91 | |
67 | |
63 | |
62 |
User | Count |
---|---|
216 | |
159 | |
96 | |
86 | |
79 |