web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Resetting a form conta...
Power Apps
Unanswered

Resetting a form containing gallery component after submission

(0) ShareShare
ReportReport
Posted on by 6
Hi
 
Hoping the community can help me with an issue resetting a component gallery to neutral selection when a new form is submitted.
 
I have set up a survey using likert scale with emoji icons that are linked to hidden form fields, connected to a sharepoint list.  All is working except for the form reset once the users submits their responses. What I would like is the form to reset from the success form button which says 'Take the survey'.
 
I have tried searching for solutions using the following actions, and even tried creating a button to clear the form with no luck.  
 
- onselect
- reset form
- onvisible
 
I am sure the solution is very simple, I have just overlooked it.
 
 
When the app starts I create the following collection which sets up all the attributes.
 
ClearCollect(Moods,{Number:1,Icon:EmojiSad,Color:Color.Red});
Collect(Moods,{Number:2,Icon:EmojiFrown,Color:Color.Orange});
Collect(Moods,{Number:3,Icon:EmojiNeutral,Color:Color.Yellow});
Collect(Moods,{Number:4,Icon:EmojiSmile,Color:Color.LightGreen});
Collect(Moods,{Number:5,Icon:EmojiHappy,Color:Color.Green});
 
I set the colors using the gallery icon color attribute using 
 
If(ThisItem.IsSelected,RGBA(255,255,255,1),ThisItem.Color)

Any help would be greatly appreciated.
Cheers
Janine
Categories:
I have the same question (0)
  • Suggested answer
    kasraouiah Profile Picture
    305 on at
    Hello,
    i would suggest to create boolean variable for example 
    Set(var,false);
     
    and set the OnVisible property of your form related to the boolean variable and when submitting your form set onSuccess property to
    Set(var,false);
    Set(var,True);
  • Suggested answer
    tsa-svd2srv Profile Picture
    204 on at
    I'm new to helping here. So if I miss the mark, please forgive me.
     
    I haven’t worked with galleries in a form in this way before, but it seems like you might need to reset the galleries to achieve the desired outcome. Based on the image, you have 10 galleries, and you would need to Reset each one. Maybe something like:
    Reset(EmojiGallery1);
    Reset(EmojiGallery2);
    Reset(EmojiGallery3);
    ...
    Reset(EmojiGallery10);

    Sidenote:
    You can simplify your Moods collection to:
    ClearCollect(
        Moods,
        {Number: 1, Icon: EmojiSad, Color: Color.Red},
        {Number: 2, Icon: EmojiFrown, Color: Color.Orange},
        {Number: 3, Icon: EmojiNeutral, Color: Color.Yellow},
        {Number: 4, Icon: EmojiSmile, Color: Color.LightGreen},
        {Number: 5, Icon: EmojiHappy, Color: Color.Green}
    );
    Let me know if anything works.
  • JC-09010220-0 Profile Picture
    6 on at
    Thanks for the tips both, I have tried both suggested solutions but no luck as yet. :-( I will keep trying.  Appreciate the collaboration.
     
    Cheers
    Janine

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard