Hi,
I would like to export data from a gallery to a Word document.
I watch the below video but it does not cover for gallery data.
https://m.youtube.com/watch?v=tyDU9bxA0L0&t=1140s
Thank you
Solved! Go to Solution.
Hi Fahd,
You'll need to create a one-row table in your Word template with a 'Repeating Section'. Each field in this row will have a 'Plain Text Content Control'.
Once you have this table in your template, highlight the entire row (including all of those 'Plain Text Content Controls') and select 'Repeating Item Content Control':
Select Properties and Title and Tag this as 'Rows':
Now you need to pass the data from your gallery to Power Automate as a JSON table. The code in PowerApps for this should be:
JSON(
Filter(
'Fiche de saisie', Statut.Value = "Approuvé", Debut >= DatePicker3Debut_3.SelectedDate, Fin <= DatePicker3Fin_3.SelectedDate
), JSONFormat.IndentFour
)
In your flow:
1. Initialize a variable as a string - Ask in PowerApps (this will be above code)
2. Create step "Parse JSON"
Content - string variable from #1 above
A cheat for this is to just put this into 'Generate from sample' --> {"test": "test"}
Run your flow once. It will fail but you will get a sample of the payload. Go into the failed flow run and copy the 'Content' from INPUTS. This is a sample payload you can now add to your Parse JSON step using the 'Generate from sample' button at the bottom.
3. In your 'Populate a Microsoft Word template' step, you should see several fields that being with 'Rows' (which is what we named the 'Repeating Item Content Control'. Click the "T" in a square in the top right of that area to switch to 'input entire array'. Here, we will use 'Body' from your Parse JSON step.
You will need to re-link your flow to your app, and add the JSON code above to pass your gallery data to the flow.
With more details on your data I could create a sample but hopefully this helps.
Hi @Fahd,
Do you want to export gallery data to word?
Could you explain in more detail how you set up the Gallery?I tested a single control in powerapps, and the results can be exported normally.I have test for your reference,please try the following workaround:
Best Regards,
Jessica Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-JessicaG-msft ,
Yes, I would like to export a gallery data to Word.
In my app, I have a gallery named "gallery12" that displays data depending a selected period with a filter .
My purpose is to export the data selected to a table of Word . Below a capture of my gallery.
I hope you have more details.
Thank you
Best regards
Hi Fahd,
You'll need to create a one-row table in your Word template with a 'Repeating Section'. Each field in this row will have a 'Plain Text Content Control'.
Once you have this table in your template, highlight the entire row (including all of those 'Plain Text Content Controls') and select 'Repeating Item Content Control':
Select Properties and Title and Tag this as 'Rows':
Now you need to pass the data from your gallery to Power Automate as a JSON table. The code in PowerApps for this should be:
JSON(
Filter(
'Fiche de saisie', Statut.Value = "Approuvé", Debut >= DatePicker3Debut_3.SelectedDate, Fin <= DatePicker3Fin_3.SelectedDate
), JSONFormat.IndentFour
)
In your flow:
1. Initialize a variable as a string - Ask in PowerApps (this will be above code)
2. Create step "Parse JSON"
Content - string variable from #1 above
A cheat for this is to just put this into 'Generate from sample' --> {"test": "test"}
Run your flow once. It will fail but you will get a sample of the payload. Go into the failed flow run and copy the 'Content' from INPUTS. This is a sample payload you can now add to your Parse JSON step using the 'Generate from sample' button at the bottom.
3. In your 'Populate a Microsoft Word template' step, you should see several fields that being with 'Rows' (which is what we named the 'Repeating Item Content Control'. Click the "T" in a square in the top right of that area to switch to 'input entire array'. Here, we will use 'Body' from your Parse JSON step.
You will need to re-link your flow to your app, and add the JSON code above to pass your gallery data to the flow.
With more details on your data I could create a sample but hopefully this helps.
Hi all,
First I am sorry to take a long time to respond you. I would like to thank you for your repsonses especially for @NuttyPistons that helped me a lot. And the below video also helped me to understand Json. Thank you.
https://www.youtube.com/watch?v=ozhIlkETwvc
Hey Nutty,
what is the content of the schema of "Parse Jason" in your example? I dont know, how to reference the content of the gallery to the datafield of word. I know that I have to tip in:
{
"dataFieldWord"="fieldOfGallery"
}
But I dont know what to put in to fieldOfGallery
Would be very happy to hear from you. 🙂
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
65 | |
51 | |
30 | |
29 | |
24 |