ParseJSON function in PowerApps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is mayuresh doshi from office365notes.com today we will learn how to make use of parse json function in powerapps this is a new feature launched by microsoft and to make use of this function we should have the latest authoring version enabled so you can check your authoring version by going into support section and click on edit here select the latest version as 91.11 now reload the app and apply the version now once the latest authoring version is enabled just reconfirm it again by going into settings and click on support yes the latest version is applied now click on upcoming features and search for parse json so we will need to enable this feature so this is experimental feature so click on ok this will save and refresh your app now click on file save and publish the app once okay now let's see how the pass json work in powerapps so to demonstrate let's add one input text box i'll make it multiline now i'll put some json string in this text box okay now i have this uh json string where i have few properties like name email address and age now if i want to convert this string into json or i need to parse this json i can make use of pass json function so let me add a few labels over here just to uh take the name email and age of the user or that string so let's say if i want to get the name property from this object i can make use of pass json function so i'll write parse json then the input text dot text and the property name so here my property name is name but when you see that it will throw an error saying that it cannot use the untyped object so untyped object are those things which do not have type defined so in this case we know that the name parameter will be a string so in that case we will need to make use of text function so this will convert our untyped object into text or string so you can now see i can get the output as name now similarly if i want the email i can make use of same function and i can retrieve the email from that json string okay now if i want the age i can make use of same function again but this time it will throw me an error saying that the age is age is a number and we are passing it as a text so we will convert this age into uh we will pass pass the function as value because it will convert your age into number so age is untyped object of but we have to convert that into integer or number so that's why we have used the value function and you can see that i got the value as 29 so in this way we can make use of pass json function now similarly let me add one another screen where i will show you how you can make use of pass json function to get the value for your array of objects so in this case i'll make use of i will use one array which contains the object so here if you see i'm using one array where i have multiple objects and if i want to show this data in my gallery i can make use of pass json function so let me add one gallery over here okay now i will make use of path json function so here i'll make use of parse json then the text box value text box dot text but this will throw me an error saying that it's a untyped object now we know that this should be a table so i'll pass the function as table now you can see that i got the values over here but all the values are again untyped but we can make use of different functions like text value to convert these untyped objects into typed one so for now let's add few labels over here okay now if i want to show let's say the name i can make use of this item dot value dot name and to convert that untyped object i will make use of text function similarly for email i can make use of text function email and if i want to show the age i can make use of value function okay now my gallery is ready and i can see that all values are correctly populated from this json string now we can also make use of a filter or lookup or index function to get the particular value now let's say there is a requirement where i want to show a name of user whose age is 30 so i can also do that so let me add one label over here outside the gallery now if i want to get the user whose age is 30 i can make use of lookup function so lookup now i'll use the same table because this is going to convert my json string into table so this is basically our data source so look up what i have to apply the condition on the age property so i will make use of value value dot age where this should be equal to let's say 30 and this lookup value i want the name of that user now to convert that untyped value i will use text function okay something is wrong here um dot okay here so this is my record now records value okay dot name so i missed that value thing then convert this to text now and you can see that i got that username whose age is 30 okay i can again make use of index function so let's say if i want to get the first item from this table so instead of passing the condition i can pass the index and you can see that the first value is my uresh so this is the index if i want the fourth user i can just pass the value as four and i got the silver in this way we can make use of index or lookup function over this sparse json function as well i hope you liked this video if so so please subscribe to my channel and share with your friends thanks for watching have a nice day
Info
Channel: Mayuresh Joshi (office365notes.com)
Views: 2,395
Rating: undefined out of 5
Keywords:
Id: x-B4gqfciQo
Channel Id: undefined
Length: 8min 1sec (481 seconds)
Published: Sat Sep 10 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.