Hi all,
I have 2 dropdown lists, what I want is that if someone select "z-Autre" my app should save the output in the dropdown2 otherwise the app should save dropdown1. All of that in order to create a new record in SharePoint.
I have the following code:
Patch(Demandes; Defaults(Demandes);{Date_début:DatePicker1.SelectedDate;Date_fin:DatePicker2.SelectedDate; Commentaires:TextInput1.Text; Titre:Label_Employe.Text;If(Dropdown2.Selected="z-Autre";Typec:Dropdown1.Selected;Typec:Dropdown2.Selected)});;Navigate(EcranSortie;ScreenTransition.CoverRight)
The error showing is: Waiting for an operator & or *
I dont sure what is the problem, either my IF inside a PATH or IM missing an operator..
Anyone have an idea?
Thank you so much,
Solved! Go to Solution.
Hi @tguihur ,
Note that if not .Value (a Choice field) the xxxxx will be either .Result if a Distinct filter or .FieldName (the actual name of the field filtered), but the syntax below should be correct. If you under the code after you have typed Dropdown1.Selected. (note second dot) you should see the valid values.
Patch(
Demandes;
Defaults(Demandes);
{
Date_début:DatePicker1.SelectedDate;
Date_fin:DatePicker2.SelectedDate;
Commentaires:TextInput1.Text;
Titre:Label_Employe.Text;
Typec:
If(
Dropdown2.Selected="z-Autre";
Dropdown1.Selected.xxxxx;
Dropdown2.Selected.xxxxx
)
}
);;
Navigate(
EcranSortie;
ScreenTransition.CoverRight
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @WarrenBelz
thank you for your answer.
I finally figured out like this:
Typec:If(Dropdown2.Selected.Colonne1="z-Autre"; Dropdown2.Selected.Colonne1;Dropdown2.Selected.Colonne1)}) ;;
Have a good day.
Hi @tguihur
dropdown.selected refers to the control. Dropdown.selected.value refers to the data in the control.
thank for your anwers @Drrickryp but the same error is still there 😐:
Patch(Demandes; Defaults(Demandes);{Date_début:DatePicker1.SelectedDate;Date_fin:DatePicker2.SelectedDate; Commentaires:TextInput1.Text; Titre:Label_Employe.Text;If(Dropdown2.Selected.Value="z-Autre";Typec:Dropdown1.Selected.value;Typec:Dropdown2.Selected.value)});;Navigate(EcranSortie;ScreenTransition.CoverRight)
Looks to me like your formula is sprinkled with semicolons (;) where comma's should have been used:
Patch(Demandes, Defaults(Demandes), {Date_début:DatePicker1.SelectedDate, Date_fin:DatePicker2.SelectedDate, Commentaires:TextInput1.Text, Titre:Label_Employe.Text; If(Dropdown2.Selected="z-Autre", Typec:Dropdown1.Selected, Typec:Dropdown2.Selected)});Navigate(EcranSortie;ScreenTransition.CoverRight)
My PowerApps travail with ;
I believe i am missing a parentheses or anything like that.
Look, the following sentence works very well. It's has ;
Patch(Demandes; Defaults(Demandes);{Date_début:DatePicker1.SelectedDate;Date_fin:DatePicker2.SelectedDate; Commentaires:TextInput1.Text; Titre:Label_Employe.Text});;Navigate(EcranSortie;ScreenTransition.CoverRight)
But I need to save either my first dropdown or the second one.
Any other idea? Thank you.
Apart from the semicolons, I think you need to move the IF statement as follows:
Patch(Demandes, Defaults(Demandes), {Date_début:DatePicker1.SelectedDate, Date_fin:DatePicker2.SelectedDate, Commentaires:TextInput1.Text, Titre:Label_Employe.Text; Typec: If(Dropdown2.Selected="z-Autre", Dropdown1.Selected.Value, Dropdown2.Selected.Value)});Navigate(EcranSortie;ScreenTransition.CoverRight)
argument type not valid
For the following code I got the error : ARGUMENT TYPE NOT VALIDE ,🤔
Typec:If(Dropdown2.Selected="z-Autre"; Dropdown2_1.Selected.Value; Dropdown2.Selected.Value)
@rvanraamsdonk THANKS
Hi @tguihur ,
Note that if not .Value (a Choice field) the xxxxx will be either .Result if a Distinct filter or .FieldName (the actual name of the field filtered), but the syntax below should be correct. If you under the code after you have typed Dropdown1.Selected. (note second dot) you should see the valid values.
Patch(
Demandes;
Defaults(Demandes);
{
Date_début:DatePicker1.SelectedDate;
Date_fin:DatePicker2.SelectedDate;
Commentaires:TextInput1.Text;
Titre:Label_Employe.Text;
Typec:
If(
Dropdown2.Selected="z-Autre";
Dropdown1.Selected.xxxxx;
Dropdown2.Selected.xxxxx
)
}
);;
Navigate(
EcranSortie;
ScreenTransition.CoverRight
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
181 | |
137 | |
96 | |
83 |