It's always hard to give a short but sharp information but I'll try to do my best.
I'm working on an app for teachers who mark checkpoints in the students reading and writing ability. The information that's saved in the datasource is the date that the student could meet a specifik criteria. The abilities are divided in different parts and these have different number of criterias.
I aim for listing the criterias in a gallery and then save the result in one datasoure, table.
The thing is, how can I save all items in the gallery to right columns in the table?
Here are more info about the thoughts:
Datasource
• One row for each student
• Columns for each criteria
• Different number of critera for each subject
• The field of a criteria will contain the date it was meet
UI
• The teacher choose class, student and subject
• Depending on subject a number of criterias (short text) is listed in a gallery.
• Each item has a checkbox and a textbox for a date.
As the student meet the criteria, the teacher mark the checkbox and that date is shown in the textbox.
Save button sends an update of the student.
The next time the teacher looks at the same screen, the checkbox isn't visiable but the data is shown in the textbox.
There will also be a screens for overview of the whole class in the subject.
Is it possible or do I have to use different screens and tables for the parts?
Regards
Ola
Hi OlaH,
Please consider to use Patch function to save data to your data source.
Patch function can be used to modify one or more records of a data source. The values of specific properties are modified without affecting other properties. It can also be used with Defaults to create records. Please check this documentation for more details:
https://powerapps.microsoft.com/en-us/tutorials/function-patch/
Please feel free reply if you need more help.
Best regards,
Mabel Mao
Hi Mabel
and thank you for your answer. Yes, I do believe that Patch is the function to use in this case. But I don't know how to do so please try to help me out.
I'll try to explain more in detail.
I want to save the records in the datasource, that's shown in the picture above.
In the gallery, I don't want to list the students (who has one row each in the datasource) but a text description for each of the columns (criterias). I've got this text in another, static datasource, that I import to the app.
And also, I want the value of the checkbox to be "Today()".
Here's another picture to clearify the gallary and the datasources.
Best regards
Ola
Hi OlaH,
Thanks for updating,
About Patch function, hope this function I am using can be a reference for you:
Patch(Student,First(Filter(Student,Name=Gallery2.Selected.Name)),{RA1:TextBox2.Text})
I created similar Excel table with you. Named it Student.
Then I show the students name on Gallery2.
Then another table named CheckPoints, I show all the items of CheckPoints On Gallery3.
Within Gallery3, add a Checkbox control and a TextBox2 control, set the TextBox2 control’s Visible property: If(Checkbox3.Value=true,true,false), set its Text property as: Today().Then when the Checkbox is selected, the date will be shown in the box.
Then add a button, set its OnSelect property as: Patch(Student,First(Filter(Student,Name=Gallery2.Selected.Name)),{RA1:TextBox2.Text})
When I click the button, the value in I selected on the app will be updated to the Student table.
Hope this can be a reference for you and be close to your scenario.
Best regards,
Mabel Mao
Thank you for your efforts in this matter.
The thing is, this works great for the first column, the one named "RA1", but in all the other ones?
"...{RA1:TextBox2.Text}"
Is there a way to change "RA1" to something like "ThisItem and "The columnname in the ds"?
Ola
Hi OlaH,
Please try if this works for you:
Add a Dropdown control, in my app its Dropdown3. And set its Items property as [“RA1”,”RA2”,”RA3”,…].
Then configure the save button’s Onselect property as:
If(Dropdown3.Selected.Value="RA1",Patch(Student,First(Filter(Student,Name=Gallery2.Selected.Name)),{RA1:TextBox2.Text}));If(Dropdown3.Selected.Value="RA2",Patch(Student,First(Filter(Student,Name=Gallery2.Selected.Name)),{RA2:TextBox2.Text}));If(Dropdown3.Selected.Value="RA3",Patch(Student,First(Filter(Student,Name=Gallery2.Selected.Name)),{RA3:TextBox2.Text}))
Hope it can be a reference for you.
Best regards,
Mabel Mao
Once again, thank you for your efforts, I really appreciate the help.
Though I haven't tested your idea I believe it would work if it were only columns; RA1, RA2 and RA3. If you look in the table you can there are many more columns. Acually there are 36 of them and therefor I need another way to do this, if there is one.
Can't an item in a gallery be a column? Must it be a row in the datasource (Excel for example)?
Ola
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
177 | |
52 | |
41 | |
36 | |
27 |
User | Count |
---|---|
240 | |
81 | |
71 | |
69 | |
66 |