cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
slong
Frequent Visitor

Integer from JSON not recognized as Number type

I am reading a pretty simple piece of JSON from a REST call response using ClearCollect.

The relevant piece of JSON looks like this 

 

 "timeSpent": "6m",
 "timeSpentSeconds": 360,
 "id": "19458",
 "issueId": "116051"

 

slong_1-1612533517669.png

When I try to use the value I get Invalid argument type: Expecting one of the following: Number, Text, Boolean

How is this possible when I am just reading a simple integer value from the JSON ?

 

1 ACCEPTED SOLUTION

Accepted Solutions
slong
Frequent Visitor

Ok, just figured it out myself. This works!

 

Last(JIRACloud.GetWorklogForIssueID(ThisRecord.key).worklogs).timeSpentSeconds

 

View solution in original post

6 REPLIES 6
notj
Post Prodigy
Post Prodigy

If it's in quotes, it looks like it's coming over as text originally. 

Try wrapping it in a Value function.

 

Value function - Power Apps | Microsoft Docs

 

Pstork1
Dual Super User III
Dual Super User III

Did you run the code through Parse JSON?  Or are you just trying to read it direct?  If you run the response through Parse JSON you can specify the schema for that field.

 

Also, I assume there is more to the response than that since what you've posted isn't a JSON record.  It just JSON formatting.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
slong
Frequent Visitor

Tried that. No luck 😞

slong
Frequent Visitor

I'm parsing it into a Collection using ClearCollect. Is there another way of parsing as you suggest ?

slong
Frequent Visitor

Ok, just figured it out myself. This works!

 

Last(JIRACloud.GetWorklogForIssueID(ThisRecord.key).worklogs).timeSpentSeconds

 

View solution in original post

Pstork1
Dual Super User III
Dual Super User III

That makes sense.  As a collection its treated as a JSON array and you were trying to access it as a JSON record.  Last() or First() will isolate the first or last record in the collection.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (83,748)