cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to create a new data entry for each submission rather than update an entry (code included)

Hi all, I'm trying to figure out how to create a new data entry every time I complete a series of questions I have designed in Power Apps. I know how to update the same row in my responses section of my data sheet, but I don't know how I can save each response and add to my list of submission. Below is my code.

 

Any help would be helpful!

 

 

If(!IsBlank(LookUp(Responses,Username=User().FullName,Responses)),
UpdateIf(Responses,Username=User().FullName,{ResponseId:ResponseId,Answer1:Radio1.Selected.OptionText, Answer2:Radio1_1.Selected.OptionText,Answer3:Radio1_2.Selected.OptionText,
Answer4:Text(Slider1.Value),
Answer5:Text(Slider1_1.Value),
Answer6:Text(Slider1_2.Value),
Answer7:Text(Slider1_3.Value),
Answer8:Text(Slider1_4.Value),
Answer9:Text(Slider1_5.Value),
Answer10:Text(Slider1_6.Value),
Answer11:TextInput1.Text,
Username:User().FullName}),


UpdateContext({NewSurvey:Patch(Responses,Defaults(Responses), {ResponseId:Text(CountRows(Responses)+1), Answer1:Radio1.Selected.OptionText,Answer2:Radio1_1.Selected.OptionText,Answer3:Radio1_2.Selected.OptionText,
Answer4:Text(Slider1.Value),
Answer5:Text(Slider1_1.Value),
Answer6:Text(Slider1_2.Value),
Answer7:Text(Slider1_3.Value),
Answer8:Text(Slider1_4.Value),
Answer9:Text(Slider1_5.Value),
Answer10:Text(Slider1_6.Value),
Answer11:TextInput1.Text,
Username:User().FullName})}));Navigate(Finish_Screen,ScreenTransition.Fade)

 

0 REPLIES 0

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

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

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (20,546)