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"
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 ?
Solved! Go to Solution.
Ok, just figured it out myself. This works!
Last(JIRACloud.GetWorklogForIssueID(ThisRecord.key).worklogs).timeSpentSeconds
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
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.
Tried that. No luck 😞
I'm parsing it into a Collection using ClearCollect. Is there another way of parsing as you suggest ?
Ok, just figured it out myself. This works!
Last(JIRACloud.GetWorklogForIssueID(ThisRecord.key).worklogs).timeSpentSeconds
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.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
72 | |
51 | |
42 | |
30 |
User | Count |
---|---|
268 | |
119 | |
94 | |
90 | |
81 |