Search code examples
microsoft-dynamicspowerappspower-automate

How to passing Text Input value from Gallery Control as a json in Power Apps?


I try to create power apps for dynamics. The main issue is changing the amount value in all list and then send the web API via power automate.

Hence, I create a flow in 'Power Automate' and Create a canvas 'Power App'. The power app is already connected to a data source. I add a 'Text Input' to enter the new value.

But I can't pass the Text Inputs value from the list. I need all 'TextInput' values from the gallery as a JSON.

Here is my code belong to action button

HttpPostTest.Run(JSON(BrowseGallery1.AllItems.'Routing number'));

I also add my screenshots.

Power App :

enter image description here

Power Automate :

enter image description here


Solution

  • To get all the items in the gallery, you need to use ForAll. Something like:

     Notify(JSON(ForAll(BrowseGallery1.AllItems, { MyVal : TextInput3.Text })))
    

    JSON() will not automatically iterate of the gallery.

    You can use Notify(JSon(...)) to help debug this and see the json payloads you're generating before making the http post.