cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Patch all items in sharepoint list with data from collection

Hello everybody,

i need your help:

There's a sharpointlist called "SPAZ".
Every collum has its definite ID, which is generated from the date and the personalnumber.
Collums: 1. Collum: SPAZ_AZ_ID (definite ID); 2. Collum: SPAZ_Tagesart: 3. Collum SPAZ_Stunden; 4. Collum: SPAZ_Abgeschlossen
There's also a collection created from another list. In this collection the same definite ID is created:
1. Collum: Col_AZ_ID (definite ID); 2. Collum: Col_Tagesart; 3. Collum: Col_Stunden; 4. Collum: Col_Abgeschlossen.
I want to update every data from the SPAZ list with the data from the collection mentioned earlier.
I created the following formula:

ForAll(AZ_Patch
Patch(Arbeitszeitenliste;LookUp(Arbeitszeitenliste; SPAZ_AZ_ID = col_AZ_ID);
{
Arbeitszeit: Table(
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
Id: LookUp(Arbeitszeitenliste; SPAZ_AZ_ID = col_AZ_ID);
Value: LookUp(AZ_Patch; col_AZ_ID = SPAZ_AZ_ID; col_Arbeitszeit)

})
}))

 

Can anybody help me?

Greetings from germany

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Patch all items in sharepoint list with data from collection

Hi @Danny2810 ,

Do you want to patch all items in your SP Lists with data from the collection table?

Could you please show more details about the "Arbeitszeit" column that you mentioned? Is it a LookUp type column in your Arbeitszeitenliste SP List?

Further, does the AZ_Patch represent the collection table in your app?

 

Based on the formula that you mentioned, I think there is something wrong with it. I assume that the AZ_Patch is the collection table that you mentioned, and the "Arbeitszeit" column is a LookUp type column in your Arbeitszeitenliste SP List, is it true?

 

I have made a test on my side, please consider modify your formula as below:

ForAll(
       AZ_Patch;
       Patch(
              Arbeitszeitenliste;
              LookUp(Arbeitszeitenliste; SPAZ_AZ_ID = AZ_Patch[@col_AZ_ID]);
              {
                SPAZ_Tagesart: AZ_Patch[@Col_Tagesart];
                SPAZ_Stunden: AZ_Patch[@Col_Stunden];
                SPAZ_Abgeschlossen: AZ_Patch[@Col_Abgeschlossen];
                Arbeitszeit: Table({
                                   Id: LookUp(ReferencedSPList; ReferencedColumn = AZ_Patch[@col_Arbeitszeit]; ID);
                                   Value: AZ_Patch[@col_Arbeitszeit]
                              })
              }
       )
)

Note: I assume that the "Arbeitszeit" (LookUp Type column) reference values from the ReferencedColumn in the ReferencedSPList. On your side, you should replace the ReferencedColumn and ReferencedSPList with actual name. The AZ_Patch collection is also generated with data from the ReferencedSPList.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Patch all items in sharepoint list with data from collection

Hello,

Yes I want to patch all selected columns.

Yes the "AZ Patch" is the collection. The sharepoint list is called "Arbeitszeiten".

The sharepoint-list has the following columns:

SPAZ_AZ_ID --> type:text --> This column contains a unique ID

SPAZ_Tagesart --> type: text --> This column should be patched with the data from the collection.

SPAZ_Arbeitszeit --> type: number --> This column should be patched with the data from the collection.

SPAZ_Tagesabschluss --> type: text --> This column should be patched with the data from the collection.

The list has a few more columns, but they should not be patched.

 

The collection has the following columns (name of the collection "AZ-Patch"):
col_AZ_ID --> The same unique ID is created in this column as the column SPAZ_AZ_ID in the sharepoint list.

col_Tagesart

col_Arbeitszeit

col_Tagesabschluss

 

As a test, i also created a gallery with the data from the collection (name of the gallery: "gal_Arbeitszeiten").

gal_AZ_ID --> The same unique ID is created in this column as the column SPAZ_AZ_ID in the sharepoint list.

gal_Tagesart

gal_Arbeitszeit

gal_Tagesabschluss

 

Thank you for your help.

Greetings

Danny

Highlighted
Helper I
Helper I

Re: Patch all items in sharepoint list with data from collection

Hello  @v-xida-msft;,

I tested your formula, but unfortunately it doesn't work. What am I doing wrong?

 

Greetings from Germany

Danny

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,930)