cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OlaH
Level: Powered On

Save gallery items in some of the columns?

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

 

result.png

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.

 

RWapp.png

 

Is it possible or do I have to use different screens and tables for the parts?

 

Regards 

Ola

6 REPLIES 6
Community Support Team
Community Support Team

Re: Save gallery items in some of the columns?

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
OlaH
Level: Powered On

Re: Save gallery items in some of the columns?

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.

Gallery items from one DS saves into another.png

 

Best regards

Ola

Community Support Team
Community Support Team

Re: Save gallery items in some of the columns?

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

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
OlaH
Level: Powered On

Re: Save gallery items in some of the columns?

Hi @v-yamao-msft

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

 

Community Support Team
Community Support Team

Re: Save gallery items in some of the columns?

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
OlaH
Level: Powered On

Re: Save gallery items in some of the columns?

Hi @v-yamao-msft

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 352 members 6,195 guests
Please welcome our newest community members: