Hi all. After patching my gallery (OnSuccess of the form) I would like to reset the visibility of the gallery to false. The gallery itself is only visible (or at least should be) if the dropdown "Zeiterfassung" is selected to "Manuell".
After saving and navigating to an other screen, coming back, the form is updated/new, but the gallery is new, but unfortunately visible...
Has anyone an idea where I made an error?
Gallery Visible: If(Dropdown12.Selected.Result = "Manuell", true, false)
Speicher/Save Button: SubmitForm(Form4); Navigate(TagesrapportViewWeek)
Form OnSuccess:
ForAll(CollectionTagesrapport, If(!IsBlank(STARTZEIT),Patch(TagesrapportManuell, Defaults(TagesrapportManuell), {ArbeitPause: ARBEITPAUSE, StartZeit: STARTZEIT, EndeZeit: ENDZEIT, IDDatenApp: Form4.LastSubmit.ID})));
NewForm(Form4);
ClearCollect(CollectionTagesrapport, {
ARBEITPAUSE: "",
STARTZEIT: "",
ENDZEIT: "",
SHOWSAVEBUTTON: true}
);
Gallery4.Visible = false;
Label34.Visible = false;
Solved! Go to Solution.
It looks like you're trying to set the visibility of the gallery when the Form OnSuccess goes through? PowerApps doesn't really work like that. You can't directly change an object from another like that.
Set the visibility of the gallery to a variable, and then change the variable from true to false in the OnSuccess.
In your OnSuccess action you are lastly trying to set the Visible properties of Gallery4 and Label34 to false. You cannot assign properties like that in PowerApps. PowerApps derives its values from formulas.
Those two lines become simple evaluations that return a true or a false and have no impact on your controls.
What you can do is to utilize a variable like : Set(controlsVisible, false)
And then in the Label34 and Gallery4 controls, set the Visible property formula to controlsVisible
I hope this is helpful for you.
It looks like you're trying to set the visibility of the gallery when the Form OnSuccess goes through? PowerApps doesn't really work like that. You can't directly change an object from another like that.
Set the visibility of the gallery to a variable, and then change the variable from true to false in the OnSuccess.
In your OnSuccess action you are lastly trying to set the Visible properties of Gallery4 and Label34 to false. You cannot assign properties like that in PowerApps. PowerApps derives its values from formulas.
Those two lines become simple evaluations that return a true or a false and have no impact on your controls.
What you can do is to utilize a variable like : Set(controlsVisible, false)
And then in the Label34 and Gallery4 controls, set the Visible property formula to controlsVisible
I hope this is helpful for you.
thank you very much @RandyHayes and @notj. With this information I was able to finish this bit of my app 🙂