Hi Community, I am a relative beginner at Power Apps and was given the task of adding a dropdown selection to a tablet app which was built by someone else in our company who is no longer here. I'm trying to a filter an already controlled by a radio button selection. I have so far tried adding a multiple " If(Dropdown_partner.SelectedText.Value="yes"), do this" to the radio button code in a few different places no avail anywhere.
I'd like to start with the dropdown selection "yes or no" then run the radio button code based on the selection of the dropdown when the button is pressed.
Any help would be "GREATLY" appreciated because I have no idea how this is supposed to work.
Thanks in advance,
Will
Screen OnVisible code:
UpdateContext({varScreenTitle: "Test Plan Creator"});Clear(colTrips);If(IsEmpty(colLocations),ClearCollect(colLocations,locations));
UpdateContext({allSel: Filter(colLocations,ZoneLeader="Yes" || New="New" )});
Set(showMenu,false);UpdateContext({Loadingvar:false,Created:false});
Radio Button OnChange code:
UpdateContext({Loadingvar:true});
Switch(
P2PTypeRadio.Selected.Value,
"Zone2Zone",
UpdateContext(
{
allSel: Filter(
colLocations,
ZoneLeader = "Yes"
)
}
);
UpdateContext({formType: "Zone2Zone"}),
"New2Zone",
UpdateContext(
{
allSel: Filter(
colLocations,
ZoneLeader = "Yes" || New = "New"
)
}
);
UpdateContext({formType: "New2Zone"}),
"Zone2Zone w/New",
UpdateContext(
{
allSel: Filter(
colLocations,
ZoneLeader = "Yes" || New = "New"
)
}
);
UpdateContext({formType: "Zone2Zone w/New"}),
"Custom",
UpdateContext({formType: "Custom"}),
"All",
UpdateContext(
{
allSel:
Filter(colLocations,New="New"||New="Normal")
}
);
UpdateContext({formType: "All"})
);
Clear(colComboTrips);UpdateContext({Loadingvar:false});
Button OnSelect code:
UpdateContext({Loadingvar:true,Created:true});
Are you trying to change the items in the dropdown based on the Radio selection? If so you need to modify your dropdown items property.
If(
P2PTypeRadio.Selected.Value = "Zone2Zone", Filter(colLocations, ZoneLeader = "Yes",
P2PTypeRadio.Selected.Value = "Zone2Zone w/new", Filter(colLocations, ZoneLeader = "Yes" And New = "New",
)
And so on
@JR-BejeweledOne "long story short, I've been given this project and I'm a real newb to Powerapps. I've watched a bunch of videos on YT, but my answer is not to be found. I also don't have any references to go back to for the code, because the person who made the app is no longer with our company.
So, I am actually trying to update the output of the Radio Button OnChange code (above), based on if "Blue" or "Red" is selected in the dropdown (Dropdown_vendor1) I've added to the screen.
I have 2 new columns in my collection (colLocations) I want to sort the original output if Red="Yes" OR Blue="Yes if selected in the new Dropdown box with Red and Blue as values.
It may look something like this in the end:
UpdateContext({allSel: Filter(colLocations, ZoneLeader = "Yes" || New = "New" && Red = "Yes")});
Which I've tried, but it doesn't work....
I hope this makes prefect sense.....???
Couple questions.
The formula on the radio Onchange property is setting the value of allSel. allSel is being used somewhere else. You can find out by going to the menu at the top left and clicking on 'View'. Then click on Variables. allSel is a local context variable and not a global variable so it won't be under the Global selection.
Select the screen to see the local context variables. Select the variable in the pane on the right and then click on the 'Uses' tab to see where it's used.
Here is what I found.
User | Count |
---|---|
196 | |
125 | |
88 | |
49 | |
42 |
User | Count |
---|---|
285 | |
162 | |
138 | |
76 | |
73 |