Parsing JSON from a SharePoint Field

  • Parsing JSON from a SharePoint Field

    Posted by DSC Communities on May 5, 2020 at 11:01 am
    • Michael Seto

      Member

      May 5, 2020 at 11:01 AM

      If I have a SharePoint field which contains multiple key/value pairs in JSON format, does PowerApps have the native capability to be able to parse values from that field? Ideally, I’d like to be able to do this ::

      SharePoint Field value ::

      {
      “name”: “michael”,
      “title”: “cloud wiz”
      }

      PowerApps Labels ::

      Label1.Text = “Name: ” & ParseJson(SharePointField.name)
      Label2.Text = “Title: ” & ParseJson(SharePointField.title)

      Thanks for your help!

      ——————————
      Michael Seto
      Cloud Wiz
      ——————————

    • Nick Miller

      Member

      May 8, 2020 at 2:51 AM

      Hello,Ā 
      You don’t have to parse json in power apps.Ā  That syntax is how you manually create a table or collection in power apps.Ā  That sp list column value is basically a table.Ā  If the gallery is each sp list item, click it and populate that row in a form, for your label and value would beĀ 

      Label1.text =Ā  First(thisitem.SharePointColumn).name

      Label2.text =Ā  First(thisitem.SharePointColumn).title

      This gets the first row (only row) of the table in that sp column.Ā  Putting the .name after the “first(…)” will return that value as a string, rather than a table.Ā Ā 
      Let me know if that solves your issue.

      ——————————
      Nick Miller
      Premier Field Engineer
      Altamonte Springs FL
      ——————————
      ——————————————-

    • Michael Seto

      Member

      May 8, 2020 at 12:51 PM

      Hey Nick,

      Not sure about what you’re looking for me to try. As a test, I created a text field (TextInput1) and entered the JSON from above as its value. I created a label (Label1) and tried to set its default text to what you suggested, First(TextInput1).name but got errors:

      Invalid argument type (Control). Expecting a table value instead.

      Invalid use of ‘.’

      ——————————
      Michael Seto
      Cloud Wiz
      ——————————
      ——————————————-

    DSC Communities replied 5 years, 11 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Parsing JSON from a SharePoint Field’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!