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

Error on on select with collect and navigate

Hello,

I am building a powerapp and I collect the info into a collection, when I press the next button, but when i place the navigate to also it gives me back an error:

li_novais_0-1623853739116.png

even when I use ";" it happens. When I remove the navigate the formula is ok and it collects the data:

li_novais_1-1623853811264.png

Can anyone help me please?

27 REPLIES 27
JacoDeRooij
Helper II
Helper II

@li_novais 
That's unfortunate to hear, can you hover above the error and grab a screenshot of the error. It might be that my version of PowerApps is newer (or older) and the , after the name should be a ;. Can you give it a try?

Collect(

resposta;
{
Auditor: txtUsername.Text,
data: Now(),
loja: Gallery2.Selected.'Nome Loja',
questão1: DataCardValue16.Selected.Value,
questão2: DataCardValue9.Selected.Value,
comentários: DataCardValue25.Text,
anexo: DataCardValue27.Attachments,
questao3: DataCardValue36.Selected.Value
}
); Navigate(Confirmação)

 

Kind regards

The error is:

li_novais_0-1623858962631.png

It means invalid name

JacoDeRooij
Helper II
Helper II

@li_novais 

The error now seems to come from the ',' after the txtUsername.Text. If you try to make it a ';' will the Now() become blue? 

 

Kind regards 

If I change from , to ; yes. When I change all it does not accept the navigate all and resposta says bad name selection

JacoDeRooij
Helper II
Helper II

@li_novais 

Oké check, then is your naming convention of the , and ; different than mine, but that should not be a problem. On other places in the app what type of special token you use to separate 2 functions?
It could also be that since your and mini , and ; are different the ; between the and of the Collect() en the start of Navigate() should be a , instead of ;.

 

Kind regards

If I put , or & ir gives me the error again. The solution is to put two different buttons but I wanted just one, it should accept 2 commands right?

li_novais
Helper II
Helper II

FOUND THE SOLUTION:

Collect(
resposta;
{
Auditor: txtUsername.Text;
data: Now();
loja: Gallery2.Selected.Title;
questão1: DataCardValue16.Selected.Value;
questão2: DataCardValue9.Selected.Value;
comentários: DataCardValue25.Text;
anexo: DataCardValue27.Attachments;
questao3: DataCardValue10.Selected.Value
}
);; Navigate(Confirmação)

JacoDeRooij
Helper II
Helper II

@li_novais 

Great you found the solutions. Somethimes these diffents in Logic language can get confusion 😉

 

Kind regards 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,488)