cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
straiderox2
Level: Powered On

Continue editing on the same line

good afternoon,

I am making an application on powerapps, based on an excel spreadsheet. I split the app to be generated in steps 1, 2, 3 etc. I want each step to save on the same line, and only in the last step it skips, but it is not working, every time I save it skips a line, attached follows photos of example.

Thanksss

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Continue editing on the same line

Hi @straiderox2 ,

How do you submit your form data? Using SubmitForm function?

Do you want these forms data in Step1, Step2, Steo3, .... are stored as a single one record in your Excel table?

 

Based on the needs that you mentioned, I think the SubmitForm function could achieve your needs. The SubmitForm function is used to submit a new record (or edit existing record) into a data source. Each time you execute the SubmitForm function, the new record would be added into your Excel table.

 

As an alternative solution, I think the Patch function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Within the Step1 screen, set the OnSelect property of the ">" icon (Next) to following:

NewForm(viagem_form);
Navigate(Tela_Viagem)

 Within the Step2 screen, set the OnSelect property of the ">" icon (Next) to following:

NewForm(third_form);
Navigate(Step3Screen)

....

....

Within the Last screen, I assume that you added a "Submit" button in the last screen, set the OnSelect property to following:

Patch(
      'ExcelTable',
       Defaults('ExcelTable'),
       ident_form.Updates,
       viagem_form.Updates,
       third_form.Updates,
       ...
);
ResetForm(ident_form);ResetForm(viagem_form);ResetForm(third_form);....

Please consider take a try with above solution, then check if the issue is solved.

 

More details about submitting multiple form data into a single one record in data source, please check the following thread:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Envio-de-dois-formul%C3%A1rio/m-p/4...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
EricLott
Level 10

Re: Continue editing on the same line

You are telling it to submit the data on each form for every step, therefore it adds a new record with each new page. My suggestion would be to explore the Patch() function and see where that takes you. I'm not familiar enough with it's function to lead you through it, but that seems to be your answer.

Eelman
Level 10

Re: Continue editing on the same line

@straiderox2 What @EricLott is correct, in that as you are using separate forms for each step, each time you submit the form a new record (ie new line) is created. One solution could be to create a collection that matches your Excel file with no records then use a combination of Collect, UpdateIf and Patch to do what you need.

Eg
create empty collection
ClearCollect(col1, yourExcelFilename); Clear(col1);

 

Step 1, starts the first line of data but only adds certain columns

Collect(col1, { column1name: column1data, column2name: column2data ... }

 

steps 2, 3, 4 ..., add the required data ( repeat this for each step)

UpdateIf( col1, First(col1), { column5name: column5data, column6name: column6data ... }

 

create new record once all data data has been collected

Patch(yourExcelFilename, Defaults(yourExcelFilename), First(col1))

 

There are probably a few different ways to do what you need. You could remove the forms and just use TextInput fields to collect / enter your data then you'd only need to do the Patch process at the end. To do this you replace the First(col1) snippet with 

{ column1name: column1data, column2name: column2data ... 3 ... 4 ...5 ... ie all your data }

Community Support Team
Community Support Team

Re: Continue editing on the same line

Hi @straiderox2 ,

How do you submit your form data? Using SubmitForm function?

Do you want these forms data in Step1, Step2, Steo3, .... are stored as a single one record in your Excel table?

 

Based on the needs that you mentioned, I think the SubmitForm function could achieve your needs. The SubmitForm function is used to submit a new record (or edit existing record) into a data source. Each time you execute the SubmitForm function, the new record would be added into your Excel table.

 

As an alternative solution, I think the Patch function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Within the Step1 screen, set the OnSelect property of the ">" icon (Next) to following:

NewForm(viagem_form);
Navigate(Tela_Viagem)

 Within the Step2 screen, set the OnSelect property of the ">" icon (Next) to following:

NewForm(third_form);
Navigate(Step3Screen)

....

....

Within the Last screen, I assume that you added a "Submit" button in the last screen, set the OnSelect property to following:

Patch(
      'ExcelTable',
       Defaults('ExcelTable'),
       ident_form.Updates,
       viagem_form.Updates,
       third_form.Updates,
       ...
);
ResetForm(ident_form);ResetForm(viagem_form);ResetForm(third_form);....

Please consider take a try with above solution, then check if the issue is solved.

 

More details about submitting multiple form data into a single one record in data source, please check the following thread:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Envio-de-dois-formul%C3%A1rio/m-p/4...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

straiderox2
Level: Powered On

Re: Continue editing on the same line

Thank you so much, it worked perfectly. Yes I am using submitform, and I did just as you indicated and it went exactly as I needed it.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,107)