cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FabioBarbosa
Helper II
Helper II

Envio de dois formulário

Boa tarde,

 

Estou criando um aplicativo no powerapps com a base de dados no sharepoint em uma unica lista.

 

No Aplicativo, tenho dois formulários que pertencem a telas diferentes. Inicalmente começo na primeira tela, preencho o formulario, clico em próximo que me leva para essa segunda tela, onde preencho este segundo formulário e clico em salvar. Na base de dados do sharepoint esta criando dois registros. Gostaria que ficassem como apenas um registro.

 

Meu submit: SubmitForm(DadosFuncionario);;SubmitForm(Anexos);;Navigate(TelaInicial;ScreenTransition.Cover)

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @FabioBarbosa ,

Could you please share a bit more about your scenario?

Do you want to submit your two forms data into a single one record in your SP List rather than separated rows?

 

Based on the needs that you mentioned, I think there is something wrong with your formula. The SubmitForm() function is used to create a new record into your data source.

 

As an fixed solution, I think the Patch function could achieve your needs. I have made a test on my side, please consider modify your formula as below (set the OnSelect property of the "Submit" button to following) :

Patch(
       'YourSPList';
        Defaults('YourSPList');
        EmployeeData.Updates;
        Attachments.Updates
);;
ResetForm(EmployeeData);;ResetForm(Attachments);;
Navigate(HomeScreen; ScreenTransition.Cover)

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

 

Please check and see if the following threads would help in your scenario:

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/How-to-Submit-multiple-times-into-1-rec...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Saving-data-from-multi-screen-power...

 

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

5 REPLIES 5
chrisog
Responsive Resident
Responsive Resident

Oi @FabioBarbosa,

 

Tudo isso é feito através do Google Tradutor, portanto, tenha paciência comigo.

 

O que eu faria na sua situação é criar uma coleção intermediária para armazenar os dados da página 1, em seguida, corrigir os dados da página 2 na mesma coleção e usar a função Coletar para criar um novo registro na sua fonte de dados. É um pouco mais complicado, mas eu prefiro fazê-lo.

 

Você pode fazer isso fazendo com que o botão 'Avançar' na página 1 colete em uma coleção local, algo como: Coletar (myNewCollection, {campo1: TextInput1.Text, campo 2: Dropdown1.Selected.Value}) etc.

 

Então, quando você concluir a página 2, o mesmo princípio se aplica, exceto o Patch (myNewCollection, ThisItem, {campo3: TextInput2.Text, campo4: TextInput4.Text}) etc.

 

Em seguida, imediatamente após esse patch, colete na sua fonte de dados com: Coletar (myActualDataSource, myNewCollection)

 

 

v-xida-msft
Community Support
Community Support

Hi @FabioBarbosa ,

Could you please share a bit more about your scenario?

Do you want to submit your two forms data into a single one record in your SP List rather than separated rows?

 

Based on the needs that you mentioned, I think there is something wrong with your formula. The SubmitForm() function is used to create a new record into your data source.

 

As an fixed solution, I think the Patch function could achieve your needs. I have made a test on my side, please consider modify your formula as below (set the OnSelect property of the "Submit" button to following) :

Patch(
       'YourSPList';
        Defaults('YourSPList');
        EmployeeData.Updates;
        Attachments.Updates
);;
ResetForm(EmployeeData);;ResetForm(Attachments);;
Navigate(HomeScreen; ScreenTransition.Cover)

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

 

Please check and see if the following threads would help in your scenario:

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/How-to-Submit-multiple-times-into-1-rec...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Saving-data-from-multi-screen-power...

 

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.
Anonymous
Not applicable

Olá,

 

 

 

 

 

 

Anonymous
Not applicable

Obrigado pela ajuda @chrisog .

 

Vou fazer os testes e vou posicionando aqui no fórum.

 

 

FabioBarbosa
Helper II
Helper II

Olá,

 

Deu certo. Obrigado a todos.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,696)