Hi Community,
I hope you are able to help me out, because I need to get this working before next week.
I'm currently making an App of where information can be viewed by Students and edited by Instructors & Admins.
It keeps making I problem with something of an IConvertible. I have refreshed sources, rebooted, re-entered the code and I'm all out of Community Pages and Google Searches.
My code is as follows:
Patch(dimCourses, ThisItem, {Title:CourseTitle2, Instructor_temporarily: CourseInstructor2, Description: CourseDescription2, IDClass: Dropdown1.Selected.IDClass})
Does anyone know how to fix this?
As an added bonus I want my code to be conditional so that based on the IDClass it will be a new line or Update an existing.
If you need any more info, please let me know. And thank you in advance for the effort.
Solved! Go to Solution.
If I correctly understood your problem, DropDown1 has on item property a list of existing class and a field for new class (to be created). If you select an existing class you update data for this class and if you select new class a new record will be created.
I guess your problem can be solved like this:
If(Dropdown1.Selected.IDClass in dimCourses.IDClass,
Patch(dimCourses, ThisItem, {Title:CourseTitle2.Text, Instructor_temporarily:
CourseInstructor2.Text, Description: CourseDescription2.Text, IDClass:
Dropdown1.Selected.IDClass}),
Patch(dimCourses, defaults(dimCourses), {Title:CourseTitle2.Text, Instructor_temporarily:
CourseInstructor2.Text, Description: CourseDescription2.Text, IDClass:
Dropdown1.Selected.IDClass})
Please give it a try ! Thx !
Hi Hardit,
I've tried the first 2 steps a few times over, but without result. I already tried it before, but hey, who knows...
The CourseTitle2 etc are TextInput Fields that are normally deactivated, but active if you press a pensil button. And the submit happens on the push of the accept button.
If CourseTitle2 and the other one are TextInput controls, you should refer to its value as CourseTitle2.Text.
Please modify your code accordingly.
Patch(dimCourses, ThisItem, {Title:CourseTitle2.Text, Instructor_temporarily: CourseInstructor2.Text, Description: CourseDescription2.Text, IDClass: Dropdown1.Selected.IDClass})
Ok,
Strangely enough..... It started to work. Tried everything for 2 weeks, went nuts, whaha. THANKS!! I have faith again.
Ok now the conditionals. Could you also help with that?
If I correctly understood your problem, DropDown1 has on item property a list of existing class and a field for new class (to be created). If you select an existing class you update data for this class and if you select new class a new record will be created.
I guess your problem can be solved like this:
If(Dropdown1.Selected.IDClass in dimCourses.IDClass,
Patch(dimCourses, ThisItem, {Title:CourseTitle2.Text, Instructor_temporarily:
CourseInstructor2.Text, Description: CourseDescription2.Text, IDClass:
Dropdown1.Selected.IDClass}),
Patch(dimCourses, defaults(dimCourses), {Title:CourseTitle2.Text, Instructor_temporarily:
CourseInstructor2.Text, Description: CourseDescription2.Text, IDClass:
Dropdown1.Selected.IDClass})
Please give it a try ! Thx !
User | Count |
---|---|
258 | |
110 | |
97 | |
57 | |
40 |