cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Radio Buttons not submitting correct

I am getting an error upon submission. This is my submit button outside of the gallery orAll(
Gallery2.AllItems,
If(
!IsBlank(Radio4.Selected.Value),
Patch(
'DE Radio',
Defaults('DE Radio'),
{
Title:Namee,
Answer: Radio4.Selected.Value,
Name_:User().FullName,
Date:Today()
}
)
)
); I only want the selected radio buttons to be submitted. Namee is a text label in the gallery and its text is ThisItem.Namee, which has the name of each item I want to patch. I am getting an error that says that title is required but I have that. Additionally it is patching random radio buttons. When I do Title:Title it picks another text label ThisItem.Area why does it choose this as the title?

80 REPLIES 80

@powerapps890 

I'm not sure entirely what to tell you in this.  These formulas you are posting appear to be different than what we already established.

 

I am noticing in my test app some unusual behavior with the Radio control and actually with AddColumns now.  I need to investigate this and determine if there is an actual bug going on currently as we have many apps that are based on similar logic and if there is a new issue, it is going to have a lot of impact.

Let me research this a bit and get back to you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

ok,I have also realized there may not be a need for 

With({usrFull: User().FullName},

ForAll(
Filter(Gallery2.AllItems, !IsBlank(Radio)),
Patch('DE Radio',
Defaults('DE Radio'),
{
Title:Namee,
Answer: Radio,
Name_:usrFull,
Date:Today()
}
)
)
); since the GUATResponses holds the answers I don't see a need to even use DE Radio. Then the only issue I would have is really with the radio filter not working correctly. As well as the issue where it will default to works for a few seconds then dissapear when scrolling. Currently, I still have the original filter in there because the other solutions you posted made the app crash, so there must be some kind of issue. @RandyHayes 

I found a solution I used.  Patch(GUAT,ThisItem,{Radio:Radio4.SelectedText.Value}) This was in the onChange of the radio button, still the same filter for the gallery, but the default is ThisItem.Radio. Now is there a way I can combine this with the default I have now? Because I just tried removing the default and inputting that and the radio filter worked! This is the current default for the radio button If(var,"",
LookUp(GUATResponses, Title=vUserMail && GUATListID=ThisItem.ID, RadioValue)
)@RandyHayes 

@powerapps890 

Apologize that I've been distracted on other issues here lately and have not had a chance to focus on your issue.

 

SUMMARY

So, the understanding that I have is that you have a GUAT list that holds the "questions" that are the items in your Gallery.

You have a GUATresponses list that holds the current responses based on the user to the items in the GUAT list.

You have a DE Radio list that holds the final submit of the questions by the user.

 

You want the ability to display all the items that are either based on dropdowns or other filters and you want the radio buttons in the items to maintain the previous selected based on the user until they hit submit to submit all their answers.  This maintaining of answers should occur from session to session, again, until they hit submit and "formalize" their answers.

 

If the above is the case, then you should have a GUAT list that has nothing to do with the answer (i.e. no Radio response go there) as that list is not a user-by-user list, but a central to all list.  The GUATresponses list will hold the user-by-user answers.  And finally, the DE Radio list will hold the final submitted answers and the GUATresponses list should have any entries for that user removed.

 

Let me know if I am on the right track.  

By the way, the big bold blue Summary title is just so that if I need to re-review this thread, I can find this assumption case easily.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Yes, you are on the right track let me show you what I have so far.F orAll(GUAT, Collect(collGUATMasterData, {C1: Step, C2:Namee, C3:LookUp(collGUATResponses, Title=vUserMail &&(GUATListID)=Text(Step), RadioValue), C4:System, C5:Scenario})); - This is in the on start
This is the default for the Radio Button - LookUp(GUATResponses, Title=vUserMail && GUATListID = Text(ThisItem.C1)).RadioValue 

This is in the onchange - Patch(
GUATResponses,
Coalesce(
LookUp(GUATResponses, Title=vUserMail && GUATListID=Text(ThisItem.C1)),
Defaults(GUATResponses)
),
{Title: vUserMail, GUATListID: ThisItem.C1, RadioValue: Radio4.Selected.Value}
); The Radio Combobox Items are RadioItems. So now the filter will work only with previous responses. It only works after a used selected radio buttons submitted and loads the app up again. This is the new filter I have Filter(
collGUATMasterData,
If(
IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All",
true,
C4 in ComboBox1.SelectedItems
) && If(
IsBlank(ComboBox1_2.Selected.Result) || ComboBox1_2.Selected.Result = "All",
true,
C5 in ComboBox1_2.SelectedItems
) && If(
IsBlank(Search_.Text),
true,
Search_.Text in C2
) && If(
IsBlank(ComboBox1_1.Selected),
true,
C3 in ComboBox1_1.SelectedItems.Value
)
@RandyHayes . I am very close to it fully working it just needs to also filter on works/doesn't/fails without having to submit and reload the app.

Is there a way to trigger app on start every time something new is added to GUATResponses because that would solve the issue @RandyHayes 

@powerapps890 

So the only reason then you are having to close and reopen is because you are using a collection that is only loading in the OnStart.

 

Change your OnChange of the Radio to:

Patch(GUATResponses,
    Coalesce(LookUp(GUATResponses, Title=vUserMail && GUATListID=Text(ThisItem.C1)),
        Defaults(GUATResponses)
    ),
    {Title: vUserMail, GUATListID: ThisItem.C1, RadioValue: Radio4.Selected.Value}
);
UpdateIf(collGUATMasterData, C1=ThisItem.C1, {C3:Self.Selected.Value})

 

That will update your collection at the same time.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

This works but there is some strange behavior going on. When I click any button it will select what I chose move to works for a second then go back to the button I chose.

@powerapps890 

Yes, this will happen because you are modifying the underlying collection of the Gallery and the Gallery will then repopulate itself.  That was why I originally took you down the road of having the Gallery items directly from a DataSource and storing your responses in a separate DataSource.  At this stage you have combined them, in a sense, and are extracting your Radio default value from the underlying collection for the Gallery - and thus, if you modify, it will "refresh" itself and you will see what you see.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

That would have been better but this was the only way that actually worked. @RandyHayes 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (101,210)