web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Apps - Collectio...
Power Apps
Answered

Power Apps - Collection to Sharepoint

(0) ShareShare
ReportReport
Posted on by 12

Hi,

 

I am trying to bring information from PowerApps Gallery (CollectionTimesheetDetails) to SharePoint in List “Timesheet Details”, but doesn’t work.

 

I think there is an error in the formula because I am using a dropdown list (which take information from another list from SharePoint – “Timesheet Task”, based on user name).

 

I wrote the formula like this:

 

ForAll(CollectionTimesheetDetails,Patch('Timesheet Details',Defaults('Timesheet Details'),{'Employee Email':varUserName.Email,'NUME ANGAJAT':varUserName.FullName,DATA:DatePicker,'TASK BY COMPANY':'Task_ Dropdown'.SelectedText,'TIME ALLOCATED(hours)':'Time_txt input'.Text, OBSERVATII:'Observatii_txt input'}))

 

 

LNeaga_Next_0-1619706858630.png

 

 

CollectionTimesheet Detalis:

 

LNeaga_Next_1-1619706858634.png

 

 

SAVE BUTON:

 

LNeaga_Next_2-1619706858640.png

 

 

 

 

Thank you very much!

Categories:
  • indhaa Profile Picture
    on at

    Patch function syntax. Hope this help.  

     

    Patch( SharePointListName, Defaults( SharePointListName ), { SharePointColumnName:  } )

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @LNeaga_Next 

    I'm not entirely sure what your collection is based off of in regard to the gallery as none of your formulas indicate how you are collecting information into it.

     

    Your Gallery already is a table/collection of the values you need, but since you're duplicating the data into another collection, please consider changing your Formula to the following:

    Collect('Timesheet Details',
     ForAll(CollectionTimesheetDetails,
     {'Employee Email': varUserName.Email,
     'NUME ANGAJAT': varUserName.FullName,
     DATA: DatePicker.SelectedDate,
     'TASK BY COMPANY': 'Task_ Dropdown'.Selected.Value,
     'TIME ALLOCATED(hours)': 'Time_txt input'.Text, 
     OBSERVATII: 'Observatii_txt input'.Text
     }
     )
    )

    Now, even in this replacement formula, you will only get the first value of the gallery if you are referencing the controls of the gallery in the above.  Again, I am not clear on what is what in your app as I don't have a clear picture of everything you have.

     

    Again though, your formula should be based on the Gallery and it would go like this:

    Collect('Timesheet Details',
     ForAll(YourGallery.AllItems,
     {'Employee Email': varUserName.Email,
     'NUME ANGAJAT': varUserName.FullName,
     DATA: DatePicker.SelectedDate,
     'TASK BY COMPANY': 'Task_ Dropdown'.Selected.Value,
     'TIME ALLOCATED(hours)': 'Time_txt input'.Text, 
     OBSERVATII: 'Observatii_txt input'.Text
     }
     )
    )

     

    Also, in both of the above, I replaced the SelectedText property you had on the dropdown with Selected.Value.  Now Value may not be correct based on your Items property of the dropdown, but you should replace that with the appropriate column from the dropdown items table.  The reason is that you should avoid the use of SelectedText as it is a deprecated property at this point.

     

    I hope this is helpful for you.

     

  • LNeaga_Next Profile Picture
    12 on at

    @RandyHayes 

     

    Thank you very much!

    Now it works for columns "Observatii" and "Time" but it doesn’t work for "Task by Company".

    This column takes information from another list from SharePoint based on UserName ( Formula: Filter('Timesheet Tasks','NUME ANGAJAT'=varUserName.FullName).

    What type of column should be "Task by company" in Sharepoint? I tried with Single Line of Text, Lookup, Number, but doesn't work. In Power Apps after I used  TASK BY COMPANY':'Task_ Dropdown'.Selected

     

    Thank you!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @LNeaga_Next 

    So the question is - what kind of column is Task by Company in your list?  AND, from the formula you provided that is assumed to be the Items property of the dropdown, what column from that Timesheet Tasks list do you want to populate in your Timesheet Details list?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard