Sharepoint for each List item. operation requires an element of type 'String'

Hi,
During our upgrade from Legacy to Windows , we are replacing our old Sharpoint activities with the new Microsoft Office 365 activities.

When trying to get sharepoint list items using the ‘For each List item’ we are encountering an error on one of our lists. The following error is given:

For Each List Item: The requested operation requires an element of type ‘String’, but the target element has type ‘Array’.

When checking the list variable, i do get the correct information for that specific list
This issue is only encountered when trying to get the items of this specific list.
What could cause this?

@Mikkel_Bank_Henriksen_MIK

Are you giving the get list info output to the for each list item?

Did you check in locals panel if list details are retrieved?

Do you have access to the list completely?

Is your list containing data ?

Cheers

Hi anil,

Thank you for the quick reply.
Yes I am retrieving the details in the locals panel:
image

The list is currently containing 2 items for testing, so that should not be an issue.

I am actually not 100% sure that our service account has complete access to the list, but if the access was limited, i should not be able to get any details at all?

@Mikkel_Bank_Henriksen_MIK

Some times if all the columns are not having data then it might throw issues

And alternately try checking the include column definition option

Can you confirm if this is the behaviour with all the lists or only this specific list

You need edit level access to thw user on the list

Cheers

Hi again, I have checked with our lead dev, and the “user” we use to access the list does have the requiered access.

Some of our colums do not contain data, but that is the structure of the list as we need it. Is this a bug with the UiPath activity?

I have tried checking the include column definition option, but unfortunately that does not help.

Until now we have not had this issue with any other lists - but we might run in to this problem during our continued upgrade.

@Mikkel_Bank_Henriksen_MIK

Yes we saw a bug with the activity when all the columns are not having data…try adding a dummy row filling all the columns…that way we can confirm what the issue is

But the error itself looks strange…can you confirm is this the behaviour with all list?

Cheers

Again thank you so much for the quick replies.

I have tried adding a dummy row containing data in all colums, but this did not solve the issue.
I even tried using the oFilter to limit the for each list item to only handle the item which has data in all colums. I still get the same error.

We are using sharepoint term store for some of the colums, could this be causing the issue?

I can only confirm that the behavior is observed with this specific list - we do however use sharepoint lists actively, so i think if it fails in this list, it might also fail in others?

Do you know if there will be a fix for the bug in the Office 365 activity?

@Mikkel_Bank_Henriksen_MIK

We are currently using sharepoint activities and as of now it fails only when columns are empty…in other situations we did not observe any such behaviour.

If you have any custom columns may be that might be an issue…not sure though…

We are using strings, choices and long text and numbers and found no issues…can check by creating a dummy list with only few columns with single line text and check if the behavious is same still

Cheers

Hi I have created a dummy list only containing columns with single line text, and this works as inteded.
As soon as i add a column using managed metadata, the error will reappear.

So it seems that using columns with managed metadata is the root of the issue - causing the UiPath activity to fail. I can easily access this data using power automate, so i dont think that this is a limitation of the microsoft API, but a bug in the UiPath activity.

We are using managed metadata across our organisation, so at some point we will need to access other sharpoint lists with managed metadata. Do you know if a solution to this is possible?

@Mikkel_Bank_Henriksen_MIK

As of now there is a limitation on UiPath microsoft activities with metadata columns…you can try with custom sharepoint activities from market place but again the are available only on legacy as of now…(might gwt upgraded as wll as there are internally developed by UiPath members)(but yea already you tried these activities and moved on i believe)

For an alternate way…may be you can trigger a power automate to update the list or need to use custom code to modify using the graph api calls

Cheers