cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jasmin_Sch
Helper IV
Helper IV

Repeating table using gallery for SharePoint list

Hi!

 

I have two SP List: 

Master List (Title, Project description, ID)

Item List (work task, project type, MasterID <- which refers to the ID of the Master list)

 

I created an app to create new work packages which multiple work tasks and used gallery for it. I used this video for it: https://www.youtube.com/watch?v=xgznk4XlPCo

 

So to create a new collection and to get from the start screen to the „new work package screen“ I took his formula for my button:

 

NewForm('Form new work package');;ClearCollect(Items; {LineTätigkeitBezug:"";LineProjekttyp:""});;Navigate('Screen New work package';ScreenTransition.Cover)

 

This work perfectly to far and I am on my new work package screen and a new collection is called items is available. In this screen at the top I put the editing form „form new work package“ which has the columns of my SP Master List as database. Below that I put my gallery which has my collection „items“ as database:

 
 
 

96F2ED8D-1EE4-4ACA-9917-91962F41D764.jpeg

 

I set the default value of the text input fields in my gallery as following:

Text input work task: ThisItem.LineTätigkeitBezug (named InputTätigkeitBezug)

Text input project type: ThisItem.LineProjekttyp (named InputProjekttyp)

 

I also put a save button in my gallery:

Save button (also creates a new row): Patch(Items; ThisItem; {LineTätigkeitBezug:InputTätigkeitBezug.Text; LineProjekttyp:InputProjekttyp.Text});; Collect(Items; {LineTätigkeitBezug:""; LineProjekttyp:""})

 

So when I want to run through my app and want to add new work task it works perfectly.

 

The only issue. I want the columns „Tätigkeit/Bezug“ and „Projekttyp“ to be choice columns in my SP list. How can I integrate this in my gallery?

 

Thank you very much!

Jasmin

 

1 ACCEPTED SOLUTION

Accepted Solutions

I solved it now!!

 

 

ForAll(Items;Patch('3400 ILLU Arbeitspakete Items';Defaults('3400 ILLU Arbeitspakete Items');{Title:LineTätigkeitBezug;Projekttyp:LineProjekttyp;Status:{Value:LineStatus}; MasterID: 'Form new work package'.LastSubmit.ID}))

 

Patch(Items; ThisItem; {LineTätigkeitBezug:InputTätigkeitBezug.Text; LineProjekttyp:InputProjekttyp.Text;LineStatus:'Input Status'.Selected.Value});;Collect(Items; {LineTätigkeitBezug:""; LineProjekttyp:"";LineStatus:"" })

View solution in original post

5 REPLIES 5
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Jasmin_Sch ,

Simply use combo/DropDown
Set the Items Property Like below.

VijayTailor_0-1614107038404.png

Set the DefaultSelectedItems Property for displaying the Present data for the record.
like below-

VijayTailor_1-1614107198440.png

Thanks,

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay

Thanks for this quick answer. I will try. 

But how can I set the item and DefaultSelectedItems Property? I can’t pick them....C8343F77-7CD5-40C6-A5E3-C3DBB57F6FC5.jpeg

Ok I got you now and put in a new drop down (Status: Offen/Erledigt) into my gallery with the correct item property. But I still cant select the DefaultSelectedItems Property.

 

When I start the app, fill my first row in the gallery and want to add another row by clicking the save button it only shows me the value “offen” in my status drop down. So when I selected “Erledigt”  it switches back to “Offen” after I clicked the save button.

 

Save Button:

Patch(Items; ThisItem; {LineTätigkeitBezug:InputTätigkeitBezug.Text; LineProjekttyp:InputProjekttyp.Text; LineStatus:InputStatus.Selected.Value});; Collect(Items; {LineTätigkeitBezug:""; LineProjekttyp:""})

 

OnSuccess Property for my new work package form: ForAll(Items;Patch('3400 ILLU Arbeitspakete Items';Defaults('3400 ILLU Arbeitspakete Items');{Title:LineTätigkeitBezug;Projekttyp:LineProjekttyp;Status:LineStatus ;MasterID: 'Form new work package'.LastSubmit.ID}))

It shows me the error: The type of argument of status doesn’t match with the expected type “record”. Type “text” was found.

 

My button to build a new collection was edited as following:

('Form new work package');;ClearCollect(Items; {LineTätigkeitBezug:"";LineProjekttyp:""; LineStatus:""});;Navigate('Screen New work package';ScreenTransition.Cover)

 

What may be the cause for this?

 

Thank you!

Hi @VijayTailor 

 

I did some changes but still I could not find the final solution. So could you please help me:

 

This is my choice column in my gallery 

43675D3E-0BA3-4F14-A42C-41BD377EE071.jpeg

To create a collection at the beginning I set this formular to my button:

 

NewForm('Form new work package');;ClearCollect(Items; {LineTätigkeitBezug:"";LineProjekttyp:"";LineStatus:"";} ;;Navigate('Screen New work package';ScreenTransition.Cover)

 

My save button:

Patch(Items; ThisItem; {LineTätigkeitBezug:InputTätigkeitBezug.Text; LineProjekttyp:InputProjekttyp.Text; LineStatus:'Input Status';;Collect(Items; {LineTätigkeitBezug:""; LineProjekttyp:"";LineStatus:””})

 

But an error shows up in the OnSuccess property of my form:

ForAll(Items;Patch('3400 ILLU Arbeitspakete Items';Defaults('3400 ILLU Arbeitspakete Items');{Title:LineTätigkeitBezug;Projekttyp:LineProjekttyp;Status:LineStatus;MasterID: 'Form new work package'.LastSubmit.ID}))

Error here: Type of argument Status does not match with expected type record. Found was text

 

Please help me how to solve this.

Thank you!

I solved it now!!

 

 

ForAll(Items;Patch('3400 ILLU Arbeitspakete Items';Defaults('3400 ILLU Arbeitspakete Items');{Title:LineTätigkeitBezug;Projekttyp:LineProjekttyp;Status:{Value:LineStatus}; MasterID: 'Form new work package'.LastSubmit.ID}))

 

Patch(Items; ThisItem; {LineTätigkeitBezug:InputTätigkeitBezug.Text; LineProjekttyp:InputProjekttyp.Text;LineStatus:'Input Status'.Selected.Value});;Collect(Items; {LineTätigkeitBezug:""; LineProjekttyp:"";LineStatus:"" })

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (108,065)