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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / json parsing error ex...
Power Apps
Answered

json parsing error expected object but got string

(1) ShareShare
ReportReport
Posted on by 10
can you please help me on this, i want to retrieve text and links which is present inside json file which is like this{
"session_id": "string",
"answer": {
"text": "string",
"links": [
"string"
]
}
}
when i am doing this i can fetch the text inside answer from below query Set(varResponse,askSRE.GetAnswer({db:Dbvar,msg:'Pass your Query'.Text,session_id:CurrentSessionID}));
Patch(DataTable,{SessionID:CurrentSessionID,Question:'Pass your Query'.Text,Answer:varResponse.answer.text});
But when i am trying to perform operation i see json parsing error expected object but got string.....can you please help on this
Categories:
I have the same question (0)
  • Kameshm05 Profile Picture
    302 Moderator on at
    Hi,

    Can you show me what will you see in the "varResponse" variable? If it is returns string you need to convert string to json.


    Please reply here if it is not solve your problem.
  • CU05081455-1 Profile Picture
    10 on at
    I see 3 variables which are there in response, I am able to see the text,session_id and links which is present in the response but not able to figure out how to get links in answer section and sent it to Excel sheet as i can see my answer type inside galary is Text and inside that i have given ThisItem.Answer...
  • Kameshm05 Profile Picture
    302 Moderator on at
    Hi,

    Here the links looks like Table, can you click on the Icon under the links. so you can get more info about that. 

    To get the text, you can use this syntax varResponse.text. 
    here the links is like an array. what do you want to exactly extract from the links array?  Just share the screenshot to understand how the links array looks.

  • CU05081455-1 Profile Picture
    10 on at
    Hi,
     
    Inside links there is links of array which i want to fetch.
     
  • Kameshm05 Profile Picture
    302 Moderator on at
    Hi,

    Thanks for the response. Where do you want to store this links? In an string column or do you have the separate table to store this links array?

    If you want to store in a single string column you can use this syntax. The syntax will give all the links as comma separated string.

    If you want to store this in separate table, you have loop the links array and need to patch into the new table.
     
    Concat( varResponse.links, Value, ", " )

    Let me know if you need more info

    Thanks
  • CU05081455-1 Profile Picture
    10 on at
    Hi,
     
    I am able to see all the links and they are clickable but now the issue is all the linked are merged into one, how can i use one link at a time if the links are stored in table, for making link as clickable i have inserted html text inside gallery.
    "<a href='" & ThisItem.Links & "' target='_blank'>" & ThisItem.Links & "</a>"
     
  • Verified answer
    Kameshm05 Profile Picture
    302 Moderator on at
    For this clickable link, you don't have to concat the table values. Just insert a gallery, add the varResponse.Links in the items property.
    Add the HTMLText control inside the gallery and set the value for the html text like below.

    "<a href='" & ThisItem.Value & "' target='_blank'>" & ThisItem.Value & "</a>"

    Thanks

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard