Home > Forum > General > Looking for ideas

Looking for ideas
0

MVP

Hi,

I've been learning Microsoft Graph API and managed to create folders (parent and child) using POST and PATCH methods in a SharePoint Library via Graph Explorer.

Now I have the following scenario. In an Item List there are X numbers of lines with folders names:
- Folder A (parent)
- Folder B (parent)
- Folder B1 (child)
- Folder B2 (child)
- Folder C (parent)
- etc...

What I would like to do is use this item list to create the folders in a SharePoint library. Additionally I'd also like to store their IDs and parent IDs in the item list so I can later use them to retrieve or store additional documents in these folders.

I can't figure out if something like that is possible with Webcon. Anyone has an idea how to do it? Even a different approach would be welcome if it helps do what I need. :)

Thank you,
M.

MVP

Hi Martin,

since we don't have a loop over item list yet, you could implement a loop in another way. Scroll down to the second post from the bottom. I'm looping over all attachments but this would also work for item lists.
https://community.webcon.com/forum/thread/699?messageid=699

There might be a problem though in regards to timeouts. You could change this so that every 3/4 items the loop is interrupted (leading to a different step) and continued using a timeout.

Best regards,
Daniel

MVP
In reply to: Martin Meze (Freelancer)

Hi Daniel and thank you!

To be honest, I thought about a similar approach yesterday night before falling asleep. But then forgot about it in the morning. LOL :D

Now I don't need to scratch my head anymore. Very useful also the comment regarding time-outs. I wouldn't think of that, so thank you again.

Best regards,
Martin

Hi Martin,

you are welcome. :)

For any future readers I will rephrase the comment to make it more clear why the two "timeouts" are something completely different and may cause problems:

There might be a problem when the loop is executed multiple times. The more items there are the longer it will take and this may result in an error because the execution took to long. This might be even more likely if external systems like the Graph API are called. You could change the loop logic so that every 3 or 4 items the loop is interrupted it leads to a different step. Upon entry in this step a timeout action is triggered which will continue the loop in a minute.

Best regards,
Daniel