Hello guys.
So i've made an app for social events at our company.
Currently, after you sign up for the event - you have to delete your signup if you have changes.
Currently i wish to change this, but i am having trouble with the code for updateif
The working code for signing up is:
Set(
MDS;
Main_ID
);;
Patch(
Deltagerliste;
Defaults(Deltagerliste);
{
SignupID: Text(
Value(
First(
Sort(
Filter(
Deltagerliste;
MDS = MainIDSignup
);
Value(SignupID);
Descending
)
).SignupID
) + 1
);
UniqueBooking: Text(
Value(
First(
Sort(
Deltagerliste;
Value(UniqueBooking);
Descending
)
).UniqueBooking
) + 1
);
Titel: Label1_3.Text;
MainIDSignup: Label24.Text;
Brugernavn: User().FullName;
Deltager: "1";
PlusOne: If(
Checkbox1.Visible;
(If(
Checkbox1.Value = true;
Text("1");
Text("0")
));
Text("0")
);
PlusKids: If(
Dropdown1.Visible;
Dropdown1.SelectedText.Value;
Text("0")
)
}
);;
Navigate(
Forside;
None
);;
What i am trying to do is update PlusKids and PlusOne with the following code
UpdateIf(
Deltagerliste;
MainIDSignup = Main_ID;
{
PlusOne: If(
Checkbox1.Visible;
(If(
Checkbox1.Value = true;
Text("1");
Text("0")
));
Text("0")
);
PlusKids: If(
Dropdown1.Visible;
Dropdown1.SelectedText.Value;
Text("0")
)
}
);;
Navigate(
Forside;
None
);;
I am getting some weird error that i am having trouble translating to English. But it seems to be something like
Expected operator error with a text along the lines of
"Operator expected. We are expecting an operator, ex "+", "*" or "&" this place in the formula"
The error is in my update code.
Any useful hints?
Solved! Go to Solution.
Specifically for the Formula you are trying to change, consider the following formula instead:
UpdateIf(
Deltagerliste;
MainIDSignup = Main_ID;
{
PlusOne: If(Checkbox1.Visible && Checkbox1.Value; "1"; "0");
PlusKids: If(Dropdown1.Visible, Dropdown1.Selected.Value; "0")
}
);;
Navigate(
Forside;
None
);;
I am also guessing that perhaps your PlusKids might be a numeric column, in which case, change to the following:
UpdateIf(
Deltagerliste;
MainIDSignup = Main_ID;
{
PlusOne: If(Checkbox1.Visible && Checkbox1.Value; "1"; "0");
PlusKids: Value(If(Dropdown1.Visible, Dropdown1.Selected.Value; "0"))
}
);;
Navigate(
Forside;
None
);;
I hope this is helpful for you.
Specifically for the Formula you are trying to change, consider the following formula instead:
UpdateIf(
Deltagerliste;
MainIDSignup = Main_ID;
{
PlusOne: If(Checkbox1.Visible && Checkbox1.Value; "1"; "0");
PlusKids: If(Dropdown1.Visible, Dropdown1.Selected.Value; "0")
}
);;
Navigate(
Forside;
None
);;
I am also guessing that perhaps your PlusKids might be a numeric column, in which case, change to the following:
UpdateIf(
Deltagerliste;
MainIDSignup = Main_ID;
{
PlusOne: If(Checkbox1.Visible && Checkbox1.Value; "1"; "0");
PlusKids: Value(If(Dropdown1.Visible, Dropdown1.Selected.Value; "0"))
}
);;
Navigate(
Forside;
None
);;
I hope this is helpful for you.
I kinda feel dumb..
I had spent so much time starring at codes that I just couldn't see that I was trying to use this under "Text" and not "OnSelect".
Therefore it obviously didn't work 🙂
Thank you for your help anyway - accepted your answer as the code you provided works.
It happens!
You know that's a sign you need to take a little break! 🙂
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
277 | |
235 | |
82 | |
38 | |
37 |
User | Count |
---|---|
352 | |
240 | |
126 | |
72 | |
54 |