Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

Attach a Link to Item from a Document Library file to a SP list created with Patch with the same consecutive number


I have an app to collect data from the users and I use this code to save it to a SharePoint list:




UpdateContext({varPopUpSpinner: true});
Patch(ConsumoHerramientasDeCorte, colShoppingCart);
Clear(colShoppingCart);Set(varNombreSolicitante, Blank());Set(varPersonaAutoriza, Blank());Reset(Cmbx_Autoriza);
Navigate(Screen1, ScreenTransition.CoverRight);




Basically I use Patch with a collection to save in bulk all the records created by the user in a SharePoint list as Datasource = ConsumoHerramientasDeCorte, and the data input is stored in a collection = colShoppingCart.

This works great (thanks to the valuable help from Reza Dorrani), and here is a screenshot of the SP list:

SharePoint ListSharePoint List

I included the field "Folio" (that means consecutive number) to bundle all the records from the same transaction. 


The trick is that in the same input the user signs the receipt = PenInput1.


I managed (thanks to the great help from Shane Young) to convert the pen input data to JSON format and I stored it in the variable varSignature.


After this code I inserted the following code to save the image to a Document Library in the same submit button:




//Run the flow




Following is the screenshot of the Flow to do this.


My Problem

Where I need help is on how to update the patched records in the SharePoint list with the link of the signature image saved in the Document Library. I have it already as Link to Item, but I can't figure out how to use Get Items that have the last "Folio" (consecutive number) to select those items and then use Update Item with Link to Item to save this link to the selected records.


If I use this code in the app I get the "Folio" (consecutive number):








But I don't know how to use it in the Flow.

In the SharePoint list I have the field "LigaImagenFima" available to insert the signature's image link.


Or if there's another easier of better way to include the signature's image link to the SharePoint list, maybe.


I really appreciate any help.

Kind regards,




Accepted Solutions

Hi @calerof :

Do you want to update the specified record through flow? (by filtering Folio)

If so,you can use'Filter Query' to get the specified records, and then use'Apply to each' to traverse them.





Best Regards,



View solution in original post

Community Support
Community Support

Hi @calerof :

Do you want to get the value of the Folio field of the first record in colShoppingCart?

If so,Please allow me to explain the difference between the syntax of power apps and flow first.

PowerApps uses the function (First\Last) to get the specified record, while Flow uses the subscript.For example:

If you need to get the first item in the specified array, then you can use:


I assume that there is an array named colShoppingCart in your flow, the code should be:



Best Regards,


@v-bofeng-msft ,

No, I don't want to get the value of the "Folio" (consecutive number) field of the first record in colShoppingCart.

What I want is clearly explained in my post. That doesn't make sense to me. The array colShoppingCart is in Power Apps.

Based on your answer, how should I accomplish to insert the link to the Document Library file in the SharePoint list in the records that were patched in the same Submit button action?

I really appreciate if someone can help me here.



Hi @calerof :

Do you want to update the specified record through flow? (by filtering Folio)

If so,you can use'Filter Query' to get the specified records, and then use'Apply to each' to traverse them.





Best Regards,



View solution in original post

@v-bofeng-msft ,

How can I find "Getitems_Filter", the second expression in the Filter Query you mention above? Never mind, I found it, Ask Power Apps. 

Then in Power Apps the Flow button expects two arguments, which are they?



Community Support
Community Support

Hi @calerof :

You will be prompted for the parameter when you call flow in powerapps. One should fill in varSignature, and the other should provide the parameters used in Filter Query.

Best Regards,


Hi @v-bofeng-msft ,

Finally got it working, thank you.


Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,487)