39
Views
4
Comments
Iterate File and merge
Application Type
Reactive

Dear All,


I have create one server action on dropdown event change. I want when user selct from dropdown so based on this selection SOP's stored against this category will be merged in single PDF but in database against the SOP I have added a quantity. In every SOP only single page is present but like suppose in any SOP quantity will be a 3 , 4 etc. so this SOP iterate based on the quantity and rest all SOP's against selected category + Iterated files will be merged in single PDF. and user must be able to download the file

PFB Flow for your reference:

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Urvashi,

Based on the shared information, I think the task implementation progress is

  • Fetching the SOP based on the selected category - Done
  • Merging SOP with multiple quantity - InProgress
  • Downloading the merged SOP - Done

For the InProgress item: I guess you are missing the logical flow - to iterate and merge the SOPs based on the Quantity value.

Required flow change highlighted in Red

Adhoc loop highlighted in Green

Implementation Steps:

  • IF Listoffiles.Current.Quantity > 1
    • Assign the Listoffiles.Current.Quantity value to a screen action local variable called Quantity.
    • Define an adhoc loop to iterate based on the quantity value.
    • In each adhoc loop iteration - 
      • Append the SOP to the main List from xyz source.
      • Quantity = Quantity - 1

If the above solution is not aligned with your requirement, please share additional info - 

  • Is Quantity means number of individual SOPs?
  • Is the Quantity value selected from the end user using dropdown?

I hope this helps!


Kind regards,

Benjith Sam

UserImage.jpg
Urvashi Sharma

Hello @Benjith Sam ,


Quantity means like suppose in database quanity is maintain as 4 against the SOP than this SOP pages iterate 4 time and merge with rest of the others SOP


I will do above solution given by you but it's not working.

I have attached the OML file for your reference.

Please check Dropdown2OnChange client action.


Kindly help me!!

PDFMergewithquanity.oml
2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Urvashi,

Thank you for sharing the requested information. 

Based on the requirement, I have made the required logical code changes in the Dropdown2OnChange client action flow.

Code Changes:

  • Only require a single v_PDFList local variable.
  • Filter out files with more than 1 quantity and iterate the filtered file list to append each SOPs as per the Quantity value.

I would highly suggest and encourage you re-learn the OutSystems development basics: https://www.outsystems.com/training/paths/18/becoming-a-reactive-web-developer/

Correction in the defined assignment nodes.

Note: I didn't tested the working of the code changes.

Refer to the attached oml.

I hope this helps you!


Kind regards,

Benjith Sam

PDFMergewithquanity.oml
UserImage.jpg
Urvashi Sharma

Hi, 

I update few of things in given OML by you and it is working fine for me. Thank you so much for your valuable time.

But in every category, there are lots of SOPs like 30 to 40 so when I click on submit it will take too much time and file is not generated.

Please suggest what I will do ?

Regards,

Urvashi

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.