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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / read the data from SQL
Power Apps
Answered

read the data from SQL

(0) ShareShare
ReportReport
Posted on by

[{"O_Inventory":[{"ItemNumber":"1020825","PrimaryQuantity":"1","Colour":"NEW","OrganizationCode":"ABC","SubInventoryCode":"Stock"},{"ItemNumber":"111111","PrimaryQuantity":"1","Colour":"SPACE GREY","OrganizationCode":"ABC","SubInventoryCode":"Stock"},{"ItemNumber":"222222","PrimaryQuantity":"2","Colour":"BLACK","OrganizationCode":"ABC","SubInventoryCode":"Stock"},{"ItemNumber":"333333","PrimaryQuantity":"1","Colour":"SILVER","OrganizationCode":"ABC","SubInventoryCode":"Stock"},{"ItemNumber":"444444","PrimaryQuantity":"1","Colour":"SPACE BLACK","OrganizationCode":"IWD","SubInventoryCode":"Stock"}],"O_ExceptionFlag":false,"O_ExceptionType":"","O_ExceptionDetails":""}]

I have retrieved data from an SQL Server database in Power Apps,  how I could created a variable with all ItemNumber values, and implemented a dropdown list. When a user selects an ItemNumber from the dropdown, the app dynamically displays relevant information associated with the chosen ItemNumber

Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @noor12 

    According to your description, do you mean you get the json(String type) from your sql server?

    I create a test app like this , i create the test data from TextInput control:

    vyueyunmsft_0-1710298420980.png

    Dropdown1 -items:

    ForAll( Table(First( Table( ParseJSON( TextInput1.Text ) ) ).Value.O_Inventory) , {ItemNumber:Text(ThisRecord.Value.ItemNumber),PrimaryQuantity:Text(ThisRecord.Value.PrimaryQuantity),Colour:Text(ThisRecord.Value.Colour),OrganizationCode:Text(ThisRecord.Value.OrganizationCode),SubInventoryCode:Text(ThisRecord.Value.SubInventoryCode)})

    vyueyunmsft_1-1710298458051.png

    Then we can select the [itemNumber] for this dropdown:

    vyueyunmsft_2-1710298476492.png

     

    Then the Gallery1-items:

    Filter( ForAll( Table(First( Table( ParseJSON( TextInput1.Text ) ) ).Value.O_Inventory) , {ItemNumber:Text(ThisRecord.Value.ItemNumber),PrimaryQuantity:Text(ThisRecord.Value.PrimaryQuantity),Colour:Text(ThisRecord.Value.Colour),OrganizationCode:Text(ThisRecord.Value.OrganizationCode),SubInventoryCode:Text(ThisRecord.Value.SubInventoryCode)}) ,ItemNumber = Dropdown1.Selected.ItemNumber)

     

    Then we can use the dropdown1 control to filter the gallery control.

    If I misunderstand what you mean, you can describe your needs and your expected outcomes in detail so that we can better help you. If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

     

     

     

     

  • noor12 Profile Picture
    on at

    in some cases, the data I received for the item number is duplicated however the other details are different, I need to remove the duplicate item number from the drop-down list. 

    noor12_0-1710395941379.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard