Get the URL's from an array of file names

How Do I get the URL’s from an array of file names for a Get File activity and how do I get the number of elements in the array?

2 Likes

Hi @ron.butler,

To get the number of elements you can use:

yourVar.Length

1 Like

Hey @ron.butler

What do you mean by URLs here please ?

Thanks
#nK

1 Like

Hi @ron.butler

In addition to @gustavo.cervelin we can also try with the below expression!

YourArrayVar.count will give the count.

Regards

2 Likes

Hello again @ron.butler,

image

I’ve just noticed that this Get list item attachments returns an array of strings.

So, if you want to retrieve its content, you can use:

yourOutputVariableName(0) to get the first element value
yourOutputVariableName(1) to get the second element value

And so on…

You also can use a for each activity to iterate through the elements.

I am not sure this will return exactly what you are looking for.

So, feel free to give us more details and also feel free to share a screenshot of the values of the output string array (if they are not private data). So perhaps we can help you better.

Thanks!

Thank You Gustavo for your question.

I can’t figure out how to build the URL the “Get File” activity requires from the information delivered by the “Get list item attachments” activity, see screenshot below and Excel file attached has the info delivered by the “Get list item attachments” activity.
image
SP File List.xlsx (11.6 KB)

2 Likes

Sorry the activity for the excel was “Get List Items” to a data table variable not “Get List Items” gives an array of attached file names.

1 Like

Hey @ron.butler

What is the version of SharePoint Activities you are using please ?

If possible please share your xaml for troubleshooting with project json.

Thanks
#nK

1 Like

Hi @Nithinkrishna,

I think @ron.butler is using this dependence:

1 Like

@ron.butler,

I’ve just found the documentation

Perhaps it and/or @radu_bucur can help us

SharePoint Custom Activities Documentation.pdf (2.8 MB)

1 Like

Thank You, that is correct, I was having trouble remembering how to find that information.

1 Like

@ron.butler,

That’s how you should build your URLwhen you use the Get File activity (page 23)

3 Likes

Thank You, I will try building the URL from this information , I also found this in the document sent earlier in the replies,

Thank you all for your assistance.

2 Likes

Hi @ron.butler,

It’s a pleasure!

When you have a chance, take a look at the attached file.

Main.xaml (9.1 KB)

Don’t forget to change the values of the variables. Note: I didn’t configure the Sharepoint Activity Scope, but just replicate it in the same way you are already doing.

If you have any problems, let us know.

If it works, also let us know and mark the answer that helped you the most as solution to close this topic :slight_smile:

Thanks!

1 Like

The xml was very helpful, I just copied the For Each and set it to my existing variables and it worked like a champ. I used my existing Get List Items" activity to find the List ID value.
image

1 Like

Amazing!!

I am glad it worked @ron.butler :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.