cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Forms uploaded file to library, based on answers to questions

Hi, I would like to take a file, uploaded via Forms, and put it in a folder structure, defined by the Forms answer.

If folder does not exist, create one, if it does exist, add in existing.
E.g.:
Form_Q1: folder archive level 1
Form_A1: Comp A
Form_Q2: folder archive level 2
Form_Q2: Doc type 1
File upload: entry.pdf

Results in entry.pdf being archived in:
Site\Library\Comp A\Doc type 1\entry.pdf

 

Thanking you in advance for helping,

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

hi @DD2020  please follow this example

 

1.PNG2.PNG

 

json

 

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "link": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "type": {},
            "size": {
                "type": "integer"
            },
            "referenceId": {
                "type": "string"
            },
            "driveId": {
                "type": "string"
            },
            "status": {
                "type": "integer"
            },
            "uploadSessionUrl": {}
        },
        "required": [
            "name",
            "link",
            "id",
            "type",
            "size",
            "referenceId",
            "driveId",
            "status",
            "uploadSessionUrl"
        ]
    }
}


Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

4 REPLIES 4
Super User II
Super User II

hi @DD2020  please follow this example

 

1.PNG2.PNG

 

json

 

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "link": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "type": {},
            "size": {
                "type": "integer"
            },
            "referenceId": {
                "type": "string"
            },
            "driveId": {
                "type": "string"
            },
            "status": {
                "type": "integer"
            },
            "uploadSessionUrl": {}
        },
        "required": [
            "name",
            "link",
            "id",
            "type",
            "size",
            "referenceId",
            "driveId",
            "status",
            "uploadSessionUrl"
        ]
    }
}


Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Thank you @ChristianAbata 

 

I have copy/paste the syntax for "parse JSON", as in your message.

 

Get the following error (xxxxxxx replaces real names):

 

InvalidJSON. The 'content' property of actions of type 'ParseJson' must be valid JSON. The provided value 'file u[{"name":"12345_xxxxxxx.pdf","link":"https://xxxxxxx/xxxxxxx/xxxxxxx/Documents/Apps/Microsoft%20Forms/xxxxxxx/Question/12345_xxxxxxx.pdf","id":"01C5SL7SHKAW2S6GOSBZGKYI5UNORZFLP3","type":null,"size":52007,"referenceId":"01C5SL7SCSKTFAQD2GJRD2JFDJ6ZHJTHLS","driveId":"b!7eD4K1I0Pk2sbq3M3b0N0ZWTag5ZinFAqWfQ1Kzpfqy2R39XMKJHRpG8SSSY1kmn","status":1,"uploadSessionUrl":null}]' cannot be parsed: 'Error parsing boolean value. Path '', line 1, position 1.'.

 

???

you can generete your schema follow this example please 😉

 

getformsImage.gif



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Thank you @ChristianAbata !

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (4,008)