cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sam44
Helper III
Helper III

Tried to "Parse JSON" but dosen't get results.

I'm building Canvas app and my data source is SharePoint list.

In my SharePoint list, I have column named "CartItems" and I would like to store collection data as JSON format.

 

With button, I wrote:

Patch('Datasource',{ID:ID},
{Title:MyItems,
 MyFavoriteItems:JSON(colMyFavoriteItems,JSONFormat.IndentFour)
}
)

As a result , I have below data in column named "CartItems".

[
    {
        "ID": 8,
        "ItemCategory": "DRINK",
        "ItemLinkURL": "https://hogehoge.com",
        "ItemPictureURL": "https://picturexxxxxxxxxxxx.jpg",
        "ItemCode": "4987035332602",
        "MinimumOrderUnit": 1,
        "RegularPrice": 3108,
        "ShowHide": true,
        "Title": "Coke 500ml"
    }
]

Then I placed one more button to parse this JSON into collection to show them to the gallery.

ClearCollect(colMyFavoriteItems, 
             MatchAll(CartItems,"(""ID"":(?<ID>[^""]*),""ItemCategory"":""(?<ItemCategory>[^""]*)"",""ItemLinkURL"":""(?<ItemLinkURL>[^""]*)"",""ItemPictureURL"":""(?<ItemPictureURL>[^""]*)"",""ItemCode"":""(?<ItemCode>[^""]*)"",""MinimumOrderUnit"":""(?<MinimumOrderUnit>[^""]*)"",""RegularPrice"":(?<RegularPrice>[^""]*))"))

but doesn't have any results....

(above is some part of schema)

 

I'm learning this with this great video  https://www.youtube.com/watch?v=M2033jUWqRY&t=1170s

Could someone know what is missing with my code.

 

Thanks.

 

 

 

 

1 REPLY 1
iAm_ManCat
Super User
Super User

@DeepakS this is your video they are referencing, could you help them out?

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,488)