web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Is it possible to crea...
Power Automate
Unanswered

Is it possible to create download links to download pdf files by PAD?

(0) ShareShare
ReportReport
Posted on by 13

Hi,

I am a new user of PAD and I wonder if it is possible to create download links to download pdf files from user inputs and list variables.

Let me explain.

I have a sample download link ie

https://www.nu.ac.bd/admit/desc_all/2201_3001_10_2021.pdf 

The fixed part of this link is https://www.nu.ac.bd/admit/desc_all/  

Of the last part, 2201 is a single value user input (here it is Exam_Code), 3001 which is a College_Code can be single or multiple user inputs, 10 is list item ranging from 10 to 50 (here it is Subject_Code), and 2021 is year user input.

The challenge here is to create download links from the user inputs and list from above, and check whether the link is active and download the required pdf files.

 

Is it possible?

 

Regards,

F. Haque

 

 

 

I have the same question (0)
  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Yes, this is easily doable.

    You can use built in actions (I would go with custom form) to obtain values from user then create URL variable:

     

    1. Get user input into variables:

    • %ExamCode%
    • %CollegeCode% - can be single or multiple user inputs. Do you still need to create one link for this multiple college code or several links? If several - you would need to add loop in the code to manage it accordingly
    •  %SubjectCode%
    • %Year%

    Then set the variable:

     

    %URL% = https://www.nu.ac.bd/admit/desc_all/%ExamCode%_%CollegeCode%_%SubjectCode%_%Year%.pdf

    Then user %URL% variable to open link (you could even skip creating the url variable and use above directly, but since you are learning pad i would use dedicated for readability).

     

    You can go through this on this topic:

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/variable-manipulation

     

    And this for creating custom form for collecting inputs:

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/custom-forms

     

  • Fazlul Profile Picture
    5 on at

    @momlo thank you very much for your kind reply. I will try your advice of custom form creation, but I have a question: how can you check the created links and start downloading PDF one after another?

    If my exam_code is 2201, college_code is 3001 and year is 2021, what would the flow look like?

    Thanks in advance

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi, you would need to use loop if you allow the user to select multiple college codes.

    If you allow user to select only one value you can use this code, see this, copy paste into your pad.

    Tip - it is faster to edit the code in text if you need to add many value options.

     

    @@statistics_Input_ChoiceSet: '4'
    @@statistics_Action_Submit: '2'
    Display.ShowCustomDialog CardTemplateJson: '''{
     \"type\": \"AdaptiveCard\",
     \"version\": \"1.4\",
     \"id\": \"AdaptiveCard\",
     \"body\": [
     {
     \"type\": \"Input.ChoiceSet\",
     \"id\": \"ExamCode\",
     \"style\": \"compact\",
     \"isMultiSelect\": false,
     \"choices\": [
     {
     \"title\": \"2201\",
     \"value\": \"2201\"
     },
     {
     \"title\": \"9999\",
     \"value\": \"9999\"
     }
     ],
     \"label\": \"${ExamCode_Label}\"
     },
     {
     \"type\": \"Input.ChoiceSet\",
     \"id\": \"CollegeCode\",
     \"style\": \"compact\",
     \"isMultiSelect\": false,
     \"choices\": [
     {
     \"title\": \"3001\",
     \"value\": \"3001\"
     },
     {
     \"title\": \"3003\",
     \"value\": \"3003\"
     }
     ],
     \"label\": \"${CollegeCode_Label}\"
     },
     {
     \"type\": \"Input.ChoiceSet\",
     \"id\": \"SubjectCode\",
     \"style\": \"compact\",
     \"isMultiSelect\": false,
     \"choices\": [
     {
     \"title\": \"1\",
     \"value\": \"1\"
     },
     {
     \"title\": \"2\",
     \"value\": \"2\"
     }
     ],
     \"label\": \"${SubjectCode_Label}\"
     },
     {
     \"type\": \"Input.ChoiceSet\",
     \"id\": \"Year\",
     \"style\": \"compact\",
     \"isMultiSelect\": false,
     \"choices\": [
     {
     \"title\": \"2022\",
     \"value\": \"2022\"
     },
     {
     \"title\": \"2021\",
     \"value\": \"2021\"
     }
     ],
     \"label\": \"${Year_Label}\"
     }
     ],
     \"actions\": [
     {
     \"type\": \"Action.Submit\",
     \"id\": \"Submit\",
     \"title\": \"${Submit_Title}\"
     },
     {
     \"type\": \"Action.Submit\",
     \"id\": \"Cancel\",
     \"associatedInputs\": \"none\",
     \"title\": \"${Cancel_Title}\",
     \"IsCancel\": true
     }
     ]
    }''' CustomFormData=> UserInput ButtonPressed=> ButtonPressed @ExamCode_Label: $'''ExamCode''' @CollegeCode_Label: $'''CollegeCode''' @SubjectCode_Label: $'''SubjectCode''' @Year_Label: $'''Year''' @Submit_Title: $'''Submit''' @Cancel_Title: $'''Cancel'''
    IF ButtonPressed = $'''Submit''' THEN
     SET URL TO $'''https://www.nu.ac.bd/admit/desc_all/%UserInput['ExamCode']%_%UserInput['CollegeCode']%_%UserInput['SubjectCode']%_%UserInput['Year']%.pdf'''
     # do something with url here
    ELSE
     EXIT Code: 0
    END

     

  • VJR Profile Picture
    7,635 on at

    Hi @Fazlul_Haque 

     

    I agree with the entire solution suggested by @momlo including the usage of Custom Form.

     

    Regarding what you are asking:

     I have a question: how can you check the created links and start downloading PDF one after another?

     

    - When you open the link manually how does it work in both cases - ie Success or Failure?

     

    In case of success, the file would directly get downloaded in the Downloads folder

     

    If failure, does it show a webpage something like "page not found", "page does not exist", etc

     

    Identify what that is and then design your Flow accordingly.

     

    Add a UI element of that text "page does not exist".

    When the Flow runs, if this element is found along with this text then it is a failure scenario.

     

  • Fazlul_Haque Profile Picture
    13 on at

    Hi @momlo What a fantastic solution you have given!

    I have been able to apply your solution by adding New Chrome instance and adding your URL variable. I could download only one file because I was not sure which loop i should run so far as multiple user inputs are concerned (in my case multiple college_code and subject_code). I think I need more time and practice to master the technique.

    Your advice to edit the code as text was awesome.

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    I'm glad you found this useful @Fazlul_Haque 

    For the multiple choices and loops - edit the respective fields in custom form and observe how output variable changes. Then read about loops and custom objects. Don't want to write more to not to take fun from you 😉

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard